hdns-go

module
v0.0.0-...-078f61a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2020 License: MIT

README

hdns: A Go library for the Hetzner DNS API

GitHub Actions status GoDoc

Package hdns is a library for the Hetzner DNS API.

The library’s documentation is available at GoDoc, the public API documentation is available at dns.hetzner.com.

Example

package main

import (
    "context"
    "fmt"
    "log"

    "github.com/Estivador/hdns-go/hdns"
)

func main() {
    client := hdns.NewClient(hdns.WithToken("token"))

    zone, _, err := client.Zone.GetByID(context.Background(), 1)
    if err != nil {
        log.Fatalf("error retrieving zone: %s\n", err)
    }
    if zone != nil {
        fmt.Printf("zone 1 is called %q\n", zone.Name)
    } else {
        fmt.Println("zone 1 not found")
    }
}

License

MIT license

Directories

Path Synopsis
Package hdns is a library for the Hetzner DNS API.
Package hdns is a library for the Hetzner DNS API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL