Thanks to visit codestin.com
Credit goes to github.com

Skip to content

70MM13/libdns-transip

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TransIP for libdns

This package implements the libdns interfaces for the TransIP API (which has a nice Go implementation here: https://github.com/transip/gotransip)

Authenticating

To authenticate you need to supply our AccountName and the path to your private key file to the Provider.

Example

Here's a minimal example of how to get all your DNS records using this libdns provider

package main

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

func main() {
        provider := transip.Provider{AccountName: "myaccountname", PrivateKeyPath: "./transip.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

TransIP provider implementation for libdns

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%