Skip to content

jobstoit/hetzner-dns-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hetzner DNS: a Go library for the Hetzner DNS API

Go Reference

Package dns is a library for the Hetzner DNS API.

The libraries documentation is available at Go Pkg, the public API documentation is available at dns.hetzner.com.

Example

package main

import (
	"context"
	"fmt"
	"log"

	"github.com/jobstoit/hetzner-dns-go/dns"
)

func main() {
	client := dns.NewClient(dns.WithToken("token"))

	record, _, err := client.Record.GetByID(context.Background(), "randomid")
	if err != nil {
		log.Fatalf("error retrieving record: %v\n", err)
	}

	fmt.Printf("record of type: '%s' found with value: %s", record.Type, record.Value)
}