internal

package
v4.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: MIT Imports: 10 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 {
	StatusCode int    `json:"-"`
	Message    string `json:"error,omitempty"`
}

func (APIError) Error

func (a APIError) Error() string

type Client

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

Client for DNS API.

func NewClient

func NewClient(token string) *Client

NewClient constructor of Client.

func (*Client) AddRRSet

func (c *Client) AddRRSet(ctx context.Context, zone, recordName, value string, ttl int) error

AddRRSet adds TXT record (create or update).

func (*Client) DeleteRRSet

func (c *Client) DeleteRRSet(ctx context.Context, zone, name string) error

DeleteRRSet removes RRSet record. https://dnsapi.gcorelabs.com/docs#operation/DeleteRRSet

func (*Client) GetRRSet

func (c *Client) GetRRSet(ctx context.Context, zone, name string) (RRSet, error)

GetRRSet gets RRSet item. https://dnsapi.gcorelabs.com/docs#operation/RRSet

func (*Client) GetZone

func (c *Client) GetZone(ctx context.Context, name string) (Zone, error)

GetZone gets zone information. https://dnsapi.gcorelabs.com/docs#operation/Zone

type RRSet

type RRSet struct {
	TTL     int       `json:"ttl"`
	Records []Records `json:"resource_records"`
}

type Records

type Records struct {
	Content []string `json:"content"`
}

type Zone

type Zone struct {
	Name string `json:"name"`
}

Jump to

Keyboard shortcuts

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