internal

package
v4.10.1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeAnycast = "anycast"
	ModeZone    = "zone"
)

Modes.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Message    string `json:"message"`
	StatusCode int    `json:"-"`
}

func (APIError) Error

func (a APIError) Error() string

type Client

type Client struct {
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

Client a nicmanager DNS client.

func NewClient

func NewClient(opts Options) *Client

NewClient create a new Client.

func (Client) AddRecord

func (c Client) AddRecord(zone string, req RecordCreateUpdate) error

func (Client) DeleteRecord

func (c Client) DeleteRecord(zone string, record int) error

func (Client) GetZone

func (c Client) GetZone(name string) (*Zone, error)

type Options

type Options struct {
	Login    string
	Username string

	Email string

	Password string
	OTP      string

	Mode string
}

Options the Client options.

type Record

type Record struct {
	ID   int    `json:"id"`
	Name string `json:"name"`

	Type    string `json:"type"`
	Content string `json:"content"`
	TTL     int    `json:"ttl"`
}

type RecordCreateUpdate

type RecordCreateUpdate struct {
	Name  string `json:"name"`
	Value string `json:"value"`
	TTL   int    `json:"ttl"`
	Type  string `json:"type"`
}

type Zone

type Zone struct {
	Name    string   `json:"name"`
	Active  bool     `json:"active"`
	Records []Record `json:"records"`
}

Jump to

Keyboard shortcuts

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