Documentation
¶
Index ¶
- Constants
- func WithBaseURL(rawBaseURL string) func(*Client) error
- type Client
- func (c *Client) CreateRecord(zoneID string, record Record) (*Record, *http.Response, error)
- func (c *Client) CreateZone(domain string) (*Zone, *http.Response, error)
- func (c *Client) DeleteRecord(zoneID, recordID string) (bool, *http.Response, error)
- func (c *Client) DeleteZone(zoneID string) (bool, *http.Response, error)
- func (c *Client) ListRecords(zoneID string) ([]Record, *http.Response, error)
- func (c *Client) ListZones() ([]Zone, *http.Response, error)
- type ErrorResponse
- type Option
- type Record
- type ResponseError
- type TokenTransport
- type Zone
Constants ¶
View Source
const ( RecordTypeA = "A" RecordTypeAAAA = "AAAA" RecordTypeCNAME = "CNAME" RecordTypeMX = "MX" RecordTypeNS = "NS" RecordTypeSOA = "SOA" RecordTypeSRV = "SRV" RecordTypeTXT = "TXT" RecordTypeDS = "DS" RecordTypePTR = "PTR" RecordTypeSSHFP = "SSHFP" RecordTypeTLSA = "TLS" )
Record types.
Variables ¶
This section is empty.
Functions ¶
func WithBaseURL ¶
WithBaseURL Allows to define a custom base URL.
Types ¶
type Client ¶
type Client struct { UserAgent string // contains filtered or unexported fields }
Client The API client.
func (*Client) CreateRecord ¶
CreateRecord Creates a new record.
func (*Client) CreateZone ¶
CreateZone Creates a zone.
func (*Client) DeleteRecord ¶
DeleteRecord Delete a record.
func (*Client) DeleteZone ¶
DeleteZone Delete a zone.
func (*Client) ListRecords ¶
ListRecords returns a list of all records in given zone.
type ErrorResponse ¶
type ErrorResponse = ResponseError
ErrorResponse A representation of an API error message. Deprecated: use ResponseError instead.
type Record ¶
type Record struct { ID string `json:"id,omitempty"` RecordType string `json:"type"` Name string `json:"name"` Content string `json:"content"` TTL int `json:"ttl,omitempty"` }
Record a DNS record.
type ResponseError ¶ added in v1.1.0
ResponseError A representation of an API error message.
func (*ResponseError) Error ¶ added in v1.1.0
func (e *ResponseError) Error() string
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, secret string) (*TokenTransport, error)
NewTokenTransport Creates a new TokenTransport.
func (*TokenTransport) Client ¶
func (t *TokenTransport) Client() *http.Client
Client Creates a new HTTP client.
Click to show internal directories.
Click to hide internal directories.