pph for libdns
This package implements the libdns interfaces for PPH using the API, allowing you to manage DNS records.
Important
This package supports API token authentication which is currently a beta feature of the provider.
Create an API Token in the Web-UI Vionity.de.
These tokens are not scoped, so be careful were you store this token.
You can either export the token by using an environment variable called API_TOKEN or the go initialization.
If you want to use the environment variable you need to pass an empty string "" to the provider struct.
You can also pass the token to the provider struct of the library.
$ export API_TOKEN="<I am a very secure token>"
>import (
"context"
"github.com/libdns/libdns"
"github.com/libdns/pph"
)
func main() {
zone := "zone.example.com"
// uses the data from the API_TOKEN environment variable
p := pph.Provider{
APIToken: "",
}
ctx := context.Background()
records, err := p.GetRecords(ctx, zone)
}Thie example uses the provider struct directly.
// With token Auth
p := pph.Provider{
APIToken: "<I am a very secure token>",
}