internal

package
v0.0.0-...-d25b310 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 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://api.gcore.com/docs/dns#tag/rrsets/operation/DeleteRRSet

func (*Client) GetRRSet

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

GetRRSet gets RRSet item. https://api.gcore.com/docs/dns#tag/rrsets/operation/RRSet

func (*Client) GetZone

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

GetZone gets zone information. https://api.gcore.com/docs/dns#tag/zones/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