Skip to content

Hetzner DNS implementation for libdns

License

Notifications You must be signed in to change notification settings

fairhat/libdns-vercel

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vercel DNS for libdns

This package implements the libdns interfaces for the Vercel DNS API

Authenticating

To authenticate you need to supply a Vercel APIToken. For Testing purposes you can get a Testing Token from your Vercel dashboard.

package main

import (
	"context"
	"fmt"
	"os"
	"time"

	"github.com/fairhat/libdns-vercel"
)

func main() {
	token := os.Getenv("LIBDNS_VERCEL_TOKEN")
	if token == "" {
		fmt.Printf("LIBDNS_VERCEL_TOKEN not set\n")
		return
	}

	zone := os.Getenv("LIBDNS_VERCEL_ZONE")
	if token == "" {
		fmt.Printf("LIBDNS_VERCEL_ZONE not set\n")
		return
	}

	p := &vercel.Provider{
		AuthAPIToken: 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)
}

About

Hetzner DNS implementation for libdns

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%