internal

package
v4.13.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: MIT Imports: 11 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(ctx context.Context, zone string, payload RecordCreateUpdate) error

func (Client) DeleteRecord

func (c Client) DeleteRecord(ctx context.Context, zone string, record int) error

func (Client) GetZone

func (c Client) GetZone(ctx context.Context, 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