File: README.md

package info (click to toggle)
golang-github-nesv-go-dynect 0.6.0%2Bgit20190806.63e11f6-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 220 kB
  • sloc: makefile: 2
file content (43 lines) | stat: -rw-r--r-- 765 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# go-dynect

A DynECT REST client for the Go programming language.

## Installation

	$ go get github.com/nesv/go-dynect/dynect

## Usage

	package main

	import (
		"github.com/nesv/go-dynect/dynect"
		"log"
	)

	func main() {
		client := dynect.NewClient("my-dyn-customer-name")
		err := client.Login("my-dyn-username", "my-dyn-password")
		if err != nil {
			log.Fatal(err)
		}

		defer func() {
			err := client.Logout()
			if err != nil {
				log.Fatal(err)
			}
		}()

		// Make a request to the API, to get a list of all, managed DNS zones
		var response dynect.ZonesResponse
		if err := client.Do("GET", "Zone", nil, &response); err != nil {
			log.Println(err)
		}

		for _, zone := range response.Data {
			log.Println("Zone", zone)
		}
	}

More to come!