Timeweb DNS for libdns
This package implements the libdns interfaces for Timeweb DNS API, allowing you to manage DNS records.
To authorize you need to use Timeweb Authorization.
Minimal working example of getting DNS zone records.
package main
import (
"context"
"fmt"
"os"
"github.com/libdns/libdns/timeweb-libdns"
)
func main() {
provider = timeweb.Provider{
ApiURL: os.Getenv("TIMEWEB_URL"),
ApiToken: os.Getenv("TIMEWEB_API_TOKEN"),
}
zone = os.Getenv("TIMEWEB_ZONE")
ctx = context.Background()
records, err := provider.GetRecords(ctx, zone)
if err != nil {
fmt.Printf("Error: %s", err)
return
}
fmt.Println(records)
}
Always yours @Riskful