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) CreateRecordWithContext(ctx context.Context, zoneID string, record Record) (*Record, *http.Response, error)
- func (c *Client) CreateZone(domain string) (*Zone, *http.Response, error)
- func (c *Client) CreateZoneWithContext(ctx context.Context, domain string) (*Zone, *http.Response, error)
- func (c *Client) DeleteRecord(zoneID, recordID string) (bool, *http.Response, error)
- func (c *Client) DeleteRecordWithContext(ctx context.Context, zoneID, recordID string) (bool, *http.Response, error)
- func (c *Client) DeleteZone(zoneID string) (bool, *http.Response, error)
- func (c *Client) DeleteZoneWithContext(ctx context.Context, zoneID string) (bool, *http.Response, error)
- func (c *Client) ListRecords(zoneID string) ([]Record, *http.Response, error)
- func (c *Client) ListRecordsWithContext(ctx context.Context, zoneID string) ([]Record, *http.Response, error)
- func (c *Client) ListZones() ([]Zone, *http.Response, error)
- func (c *Client) ListZonesWithContext(ctx context.Context) ([]Zone, *http.Response, error)
- type ErrorResponsedeprecated
- type Option
- type Record
- type ResponseError
- type TokenTransport
- type Zone
Constants ¶
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) CreateRecordWithContext ¶ added in v1.2.0
func (c *Client) CreateRecordWithContext(ctx context.Context, zoneID string, record Record) (*Record, *http.Response, error)
CreateRecordWithContext Creates a new record.
func (*Client) CreateZone ¶
CreateZone Creates a zone.
func (*Client) CreateZoneWithContext ¶ added in v1.2.0
func (c *Client) CreateZoneWithContext(ctx context.Context, domain string) (*Zone, *http.Response, error)
CreateZoneWithContext Creates a zone.
func (*Client) DeleteRecord ¶
DeleteRecord Delete a record.
func (*Client) DeleteRecordWithContext ¶ added in v1.2.0
func (c *Client) DeleteRecordWithContext(ctx context.Context, zoneID, recordID string) (bool, *http.Response, error)
DeleteRecordWithContext Delete a record.
func (*Client) DeleteZone ¶
DeleteZone Delete a zone.
func (*Client) DeleteZoneWithContext ¶ added in v1.2.0
func (c *Client) DeleteZoneWithContext(ctx context.Context, zoneID string) (bool, *http.Response, error)
DeleteZoneWithContext Delete a zone.
func (*Client) ListRecords ¶
ListRecords returns a list of all records in given zone.
func (*Client) ListRecordsWithContext ¶ added in v1.2.0
func (c *Client) ListRecordsWithContext(ctx context.Context, zoneID string) ([]Record, *http.Response, error)
ListRecordsWithContext returns a list of all records in given zone.
type ErrorResponse
deprecated
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.