Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 874 Bytes

README.md

File metadata and controls

30 lines (22 loc) · 874 Bytes

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)
}