jobstoit / hetzner-dns-go

A Go library for the Hetzner DNS API
https://pkg.go.dev/github.com/jobstoit/hetzner-dns-go/dns
MIT License
1 stars 1 forks source link
api go golang hcloud hetzner hetzner-cloud

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