Skip to content

Core interfaces for universal DNS record manipulation across providers

License

Notifications You must be signed in to change notification settings

justinvdk/libdns-leaseweb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leaseweb provider for libdns

Go Reference

This package implements the libdns interfaces for Leaseweb, allowing you to manage DNS records.

Usage

Generate an API Key via the Leaseweb customer portal; under Administration -> API Key.

Place API Key in the configuration as APIKey.

Compiling

Docker

Run:

docker run --rm -it -v "$PWD":/usr/local/go/src/leaseweb -w /usr/local/go/src/leaseweb golang:1.16

which will drop you in an interactive bash prompt where go and friends are available.

For example you can build the code with go build.

Example

package main

import (
	"context"
	"fmt"
	"github.com/libdns/leaseweb"
)

func main() {
	provider := leaseweb.Provider{APIKey: "<LEASEWEB API KEY>"}

	records, err  := provider.GetRecords(context.TODO(), "example.com")
	if err != nil {
		fmt.Println(err.Error())
	}

	for _, record := range records {
		fmt.Printf("%s %v %s %s\n", record.Name, record.TTL.Seconds(), record.Type, record.Value)
	}
}

About

Core interfaces for universal DNS record manipulation across providers

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%