Fuerback / go-vinyldns

Go client package for VinylDNS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Go client package for VinylDNS

License:Apache License 2.0


Languages

Language:Go 98.8%Language:Makefile 1.2%