Documentation ¶
Index ¶
- type APIException
- type APIResponse
- type Client
- func (c Client) AddNewRecord(ctx context.Context, domainID int64, record DNSRecord) error
- func (c Client) DeleteRecord(ctx context.Context, domainID, recordID int64) error
- func (c Client) GetRecords(ctx context.Context, hostname, recordType string) ([]DNSRecord, error)
- func (c Client) GetRootDomain(ctx context.Context, hostname string) (*DNSHostname, error)
- type DNSHostname
- type DNSRecord
- type RecordResponse
- type RecordsResponse
- type TokenTransport
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 ¶
func (Client) AddNewRecord ¶
AddNewRecord Add a new DNS record for DNS service.
func (Client) DeleteRecord ¶
DeleteRecord Remove a DNS record from DNS service.
func (Client) GetRecords ¶
GetRecords Get DNS records based on a hostname and resource record type.
func (Client) GetRootDomain ¶
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.