Package hdns
is a library for the Hetzner DNS API.
The library’s documentation is available at GoDoc, the public API documentation is available at dns.hetzner.com.
package main
import (
"context"
"fmt"
"log"
"github.com/Estivador/hdns-go/hdns"
)
func main() {
client := hdns.NewClient(hdns.WithToken("token"))
zone, _, err := client.Zone.GetByID(context.Background(), 1)
if err != nil {
log.Fatalf("error retrieving zone: %s\n", err)
}
if zone != nil {
fmt.Printf("zone 1 is called %q\n", zone.Name)
} else {
fmt.Println("zone 1 not found")
}
}
MIT license