internal

package
v4.14.4 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIResponse

type APIResponse struct {
	TransactID string `json:"transactid"`
	Status     string `json:"status"`
	Message    string `json:"message,omitempty"`
	Code       int    `json:"code,omitempty"`
}

func (APIResponse) Error

func (a APIResponse) Error() string

type Client

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

Client is the API client.

func NewClient

func NewClient(apiKey string, password string) *Client

NewClient creates a new Client.

func (Client) AddRecord

func (c Client) AddRecord(ctx context.Context, query RecordQuery) error

AddRecord The command is intended to add a new DNS record to a specific zone (domain).

func (Client) ListRecords

func (c Client) ListRecords(ctx context.Context, query ListRecordQuery) ([]Record, error)

ListRecords The command is intended to retrieve the list of DNS records for a specific domain.

func (Client) RemoveRecord

func (c Client) RemoveRecord(ctx context.Context, query RecordQuery) error

RemoveRecord The command is intended to remove a DNS record from a specific zone.

type ListRecordQuery

type ListRecordQuery struct {
	Domain     string `url:"Domain"`
	FilterType string `url:"FilterType,omitempty"`
}

type ListResponse

type ListResponse struct {
	APIResponse

	TotalRecords int      `json:"total_records,omitempty"`
	Records      []Record `json:"records,omitempty"`
}

type Record

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

type RecordQuery

type RecordQuery struct {
	FullRecordName string `url:"fullrecordname"`
	Type           string `url:"type"`
	Value          string `url:"value,omitempty"`
	TTL            int    `url:"ttl,omitempty"`
}

Jump to

Keyboard shortcuts

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