internal

package
v4.12.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2023 License: MIT Imports: 11 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"`
}

func (APIError) Error

func (a APIError) Error() string

type AddRecordResponse

type AddRecordResponse struct {
	Data struct {
		ID int `json:"id"`
	} `json:"data"`
	Meta struct {
		Location string `json:"location"`
	}
}

type Client

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

Client the UKFast SafeDNS client.

func NewClient

func NewClient(authToken string) *Client

NewClient Creates a new Client.

func (*Client) AddRecord

func (c *Client) AddRecord(ctx context.Context, zone string, record Record) (*AddRecordResponse, error)

AddRecord adds a DNS record.

func (*Client) RemoveRecord

func (c *Client) RemoveRecord(ctx context.Context, zone string, recordID int) error

RemoveRecord removes a DNS record.

type Record

type Record struct {
	Name    string `json:"name"`
	Type    string `json:"type"`
	Content string `json:"content"`
	TTL     int    `json:"ttl"`
}

Jump to

Keyboard shortcuts

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