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: 6 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 {
	Error ErrorContent `json:"error"`
}

type Auth

type Auth struct {
	AccessToken  string `json:"accessToken,omitempty"`
	RefreshToken string `json:"refreshToken,omitempty"`
}

type AuthResponse

type AuthResponse struct {
	Auth Auth `json:"auth,omitempty"`
}

type Authorization

type Authorization struct {
	Email    string `json:"email,omitempty"`
	Password string `json:"password,omitempty"`
}

type Client

type Client struct {
	AccessToken string
	ClientID    string
	Email       string
	Password    string
	TTL         int
	HTTPClient  *http.Client
	// contains filtered or unexported fields
}

Client handles all communication with CloudDNS API.

func NewClient

func NewClient(clientID, email, password string, ttl int) *Client

NewClient returns a Client instance configured to handle CloudDNS API communication.

func (*Client) AddRecord

func (c *Client) AddRecord(zone, recordName, recordValue string) error

AddRecord is a high level method to add a new record into CloudDNS zone.

func (*Client) DeleteRecord

func (c *Client) DeleteRecord(zone, recordName string) error

DeleteRecord is a high level method to remove a record from zone.

type Domain

type Domain struct {
	ID         string `json:"id,omitempty"`
	DomainName string `json:"domainName,omitempty"`
	Status     string `json:"status,omitempty"`
}

type DomainInfo

type DomainInfo struct {
	ID                   string   `json:"id,omitempty"`
	DomainName           string   `json:"domainName,omitempty"`
	LastDomainRecordList []Record `json:"lastDomainRecordList,omitempty"`
	SoaTTL               int      `json:"soaTtl,omitempty"`
	Status               string   `json:"status,omitempty"`
}

type ErrorContent

type ErrorContent struct {
	Code    int    `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
}

type Record

type Record struct {
	ID       string `json:"id,omitempty"`
	DomainID string `json:"domainId,omitempty"`
	Name     string `json:"name,omitempty"`
	Value    string `json:"value,omitempty"`
	Type     string `json:"type,omitempty"`
}

Record represents a DNS record.

type Search struct {
	Name     string `json:"name,omitempty"`
	Operator string `json:"operator,omitempty"`
	Type     string `json:"type,omitempty"`
	Value    string `json:"value,omitempty"`
}

Search used for searches in the CloudDNS API.

type SearchQuery

type SearchQuery struct {
	Limit  int      `json:"limit,omitempty"`
	Offset int      `json:"offset,omitempty"`
	Search []Search `json:"search,omitempty"`
	Sort   []Sort   `json:"sort,omitempty"`
}

type SearchResponse

type SearchResponse struct {
	Items     []Domain `json:"items,omitempty"`
	Limit     int      `json:"limit,omitempty"`
	Offset    int      `json:"offset,omitempty"`
	TotalHits int      `json:"totalHits,omitempty"`
}

type Sort

type Sort struct {
	Ascending bool   `json:"ascending,omitempty"`
	Name      string `json:"name,omitempty"`
}

Jump to

Keyboard shortcuts

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