This package implements the libdns interfaces for the Linode Domains API.
To authenticate you need to supply a Linode Personal Access Token.
Here's a minimal example of how to get all DNS records for a zone. See also: provider_test.go
package main
import (
"context"
"fmt"
"os"
"time"
"github.com/tosie/libdns-hetzner"
)
func main() {
token := os.Getenv("LIBDNS_LINODE_TOKEN")
if token == "" {
fmt.Printf("LIBDNS_LINODE_TOKEN not set\n")
return
}
zone := os.Getenv("LIBDNS_LINODE_ZONE")
if token == "" {
fmt.Printf("LIBDNS_LINODE_ZONE not set\n")
return
}
p := &linode.Provider{
APIToken: token,
}
records, err := p.GetRecords(context.WithTimeout(context.Background(), time.Duration(15*time.Second)), zone)
if err != nil {
fmt.Printf("Error: %s", err.Error())
return
}
fmt.Println(records)
}