jobstoit / hetzner-dns-go

A Go library for the Hetzner DNS API

Home Page:https://pkg.go.dev/github.com/jobstoit/hetzner-dns-go/dns

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

A Go library for the Hetzner DNS API

https://pkg.go.dev/github.com/jobstoit/hetzner-dns-go/dns

License:MIT License


Languages

Language:Go 100.0%