internal

package
v4.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIException

type APIException struct {
	Message    string `json:"message,omitempty"`
	StatusCode int32  `json:"statusCode,omitempty"`
	Type       string `json:"type,omitempty"`
}

APIException defines model for apiException.

func (APIException) Error

func (a APIException) Error() string

type APIResponse

type APIResponse struct {
	Exception  *APIException `json:"exception,omitempty"`
	StatusCode int32         `json:"statusCode,omitempty"`
}

APIResponse defines model for apiResponse.

type Client

type Client struct {
	HTTPClient *http.Client
	BaseURL    string
}

func NewClient

func NewClient() *Client

func (Client) AddNewRecord

func (c Client) AddNewRecord(domainID int64, record DNSRecord) error

AddNewRecord Add a new DNS record for DNS service.

func (Client) DeleteRecord

func (c Client) DeleteRecord(domainID, recordID int64) error

DeleteRecord Remove a DNS record from DNS service.

func (Client) GetRecords

func (c Client) GetRecords(hostname, recordType string) ([]DNSRecord, error)

GetRecords Get DNS records based on a hostname and resource record type.

func (Client) GetRootDomain

func (c Client) GetRootDomain(hostname string) (*DNSHostname, error)

GetRootDomain Get the root domain name based on a hostname.

type DNSHostname

type DNSHostname struct {
	*APIException

	ID         int64  `json:"id,omitempty"`
	DomainName string `json:"domainName,omitempty"`
	Hostname   string `json:"hostname,omitempty"`
	Node       string `json:"node,omitempty"`
}

DNSHostname defines model for DNS.hostname.

type DNSRecord

type DNSRecord struct {
	ID         int64  `json:"id,omitempty"`
	Type       string `json:"recordType,omitempty"`
	DomainID   int64  `json:"domainId,omitempty"`
	DomainName string `json:"domainName,omitempty"`
	NodeName   string `json:"nodeName,omitempty"`
	Hostname   string `json:"hostname,omitempty"`
	State      bool   `json:"state,omitempty"`
	Content    string `json:"content,omitempty"`
	TextData   string `json:"textData,omitempty"`
	TTL        int    `json:"ttl,omitempty"`
}

DNSRecord defines model for dnsRecords.

type RecordResponse

type RecordResponse struct {
	*APIException

	DNSRecord
}

RecordResponse defines model for recordResponse.

type RecordsResponse

type RecordsResponse struct {
	*APIException

	DNSRecords []DNSRecord `json:"dnsRecords,omitempty"`
}

RecordsResponse defines model for recordsResponse.

type TokenTransport

type TokenTransport struct {

	// Transport is the underlying HTTP transport to use when making requests.
	// It will default to http.DefaultTransport if nil.
	Transport http.RoundTripper
	// contains filtered or unexported fields
}

TokenTransport HTTP transport for API authentication.

func NewTokenTransport

func NewTokenTransport(apiKey string) (*TokenTransport, error)

NewTokenTransport Creates a HTTP transport for API authentication.

func (*TokenTransport) Client

func (t *TokenTransport) Client() *http.Client

Client Creates a new HTTP client.

func (*TokenTransport) RoundTrip

func (t *TokenTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip executes a single HTTP transaction.

func (*TokenTransport) Wrap

func (t *TokenTransport) Wrap(client *http.Client) *http.Client

Wrap Wrap a HTTP client Transport with the TokenTransport.

Jump to

Keyboard shortcuts

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