internal

package
v3.8.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

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

APIError represents an error response from the API.

func (APIError) Error

func (a APIError) Error() string

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents DNS client.

func NewClient

func NewClient(opts ClientOpts, httpClient *http.Client) *Client

NewClient returns a client instance.

func (*Client) AddRecord

func (c *Client) AddRecord(zone string, record Record) error

AddRecord adds Record for given zone.

func (*Client) DeleteRecord

func (c *Client) DeleteRecord(zone string, record Record) error

DeleteRecord deletes a Record for given zone.

func (*Client) SetRecord

func (c *Client) SetRecord(zone string, record Record) error

SetRecord sets a unique Record for given zone.

type ClientOpts

type ClientOpts struct {
	BaseURL string
	Token   string
}

ClientOpts represents options to init client.

type Record

type Record struct {
	Data     string `json:"data,omitempty"`
	Name     string `json:"name,omitempty"`
	Priority uint32 `json:"priority,omitempty"`
	TTL      uint32 `json:"ttl,omitempty"`
	Type     string `json:"type,omitempty"`
	Comment  string `json:"comment,omitempty"`
}

Record represents a DNS record.

type RecordChangeAdd

type RecordChangeAdd struct {
	Records []*Record `json:"records,omitempty"`
}

RecordChangeAdd represents a list of add operations.

type RecordChangeDelete

type RecordChangeDelete struct {
	Data string `json:"data,omitempty"`
	Name string `json:"name,omitempty"`
	Type string `json:"type,omitempty"`
}

RecordChangeDelete represents a list of delete operations.

type RecordChangeSet

type RecordChangeSet struct {
	Data    string    `json:"data,omitempty"`
	Name    string    `json:"name,omitempty"`
	TTL     uint32    `json:"ttl,omitempty"`
	Type    string    `json:"type,omitempty"`
	Records []*Record `json:"records,omitempty"`
}

RecordChangeSet represents a list of set operations.

type UpdateDNSZoneRecordsRequest

type UpdateDNSZoneRecordsRequest struct {
	DNSZone          string        `json:"dns_zone,omitempty"`
	Changes          []interface{} `json:"changes,omitempty"`
	ReturnAllRecords bool          `json:"return_all_records,omitempty"`
}

UpdateDNSZoneRecordsRequest represents a request to update DNS records on the API.

Jump to

Keyboard shortcuts

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