Skip to content

vinyldns/go-vinyldns

Repository files navigation

Build and Release Go Report Card Godoc GitHub

vinyldns

A Golang client for the vinyldns DNS as a service API.

Usage

Basic usage requires instantiating a client and using the vinyldns/api.go methods to interact with vinyldns:

For example:

import "github.com/vinyldns/go-vinyldns/vinyldns"

client := vinyldns.NewClient(vinyldns.ClientConfiguration{
  "accessKey",
  "secretKey",
  "my-vinyldns-host.com",
  "my custom user agent",
})

// For example, fetch zones...
// returns vinyldns.Error, []vinyldns.Zone
zs, err := client.Zones()

Alternatively, NewClientFromEnv instantiates a client from the following environment variables:

VINYLDNS_ACCESS_KEY=
VINYLDNS_SECRET_KEY=
VINYLDNS_HOST=

# Optional; defaults to `go-vinyldns/<version>`
VINYLDNS_USER_AGENT=
import "github.com/vinyldns/go-vinyldns/vinyldns"

client := vinyldns.NewClientFromEnv()

See vinyldns/${resource}_resources.go files for the various vinyldns resource structs.

See vinyldns/${resource}.go files for the various vinyldns API methods.

Development

Run tests w/ code coverage:

make test

Install:

make install