Documentation
¶
Index ¶
- Constants
- Variables
- type CreateDNSRecordResponse
- type CreateDNSRecordResult
- type Cred
- type DNS
- func (d *DNS) ClearSRVRecord(ctx context.Context, name string, target string, service string, ...) error
- func (d *DNS) CreateDNSRecord(ctx context.Context, recordType string, name string, content string, ttl uint, ...) error
- func (d *DNS) CreateSRVRecord(ctx context.Context, name string, target string, ttl uint, priority uint, ...) error
- func (d *DNS) DeleteDNSRecord(ctx context.Context, recordID string) error
- func (d *DNS) ExportZone(ctx context.Context) (exportedZoneBytes []byte, err error)
- func (d *DNS) ListDNSRecord(ctx context.Context, recordType string, name string, content string, ...) ([]DNSRecordResponseEntry, error)
- func (d *DNS) SetDNSRecord(ctx context.Context, recordType string, name string, content string, ttl uint, ...) error
- func (d *DNS) SetSRVRecord(ctx context.Context, name string, target string, ttl uint, priority uint, ...) error
- func (d *DNS) UpdateDNSRecord(ctx context.Context, recordID string, recordType string, name string, ...) error
- func (d *DNS) UpdateSRVRecord(ctx context.Context, recordID string, name string, target string, ttl uint, ...) error
- type DNSRecordResponseEntry
- type DNSRecordResponseResultInfo
- type DeleteDNSRecordResponse
- type DeleteDNSRecordResult
- type GetZonesResult
- type GetZonesResultItem
- type GetZonesResultPage
- type ListDNSRecordError
- type ListDNSRecordResponse
- type Zone
Constants ¶
const (
// AutomaticTTL should be used to request cloudflare's Automatic TTL setting (which is 1).
AutomaticTTL = 1
)
Variables ¶
var ErrDuplicateZoneNameFound = fmt.Errorf("more than a single zone name found to match the requested zone name")
ErrDuplicateZoneNameFound is used when a user that is not permitted in a given zone attempt to perform an operation on that zone.
var ErrUserNotPermitted = fmt.Errorf("user not permitted in zone")
ErrUserNotPermitted is used when a user that is not permitted in a given zone attempt to perform an operation on that zone.
Functions ¶
This section is empty.
Types ¶
type CreateDNSRecordResponse ¶
type CreateDNSRecordResponse struct { Success bool `json:"success"` Errors []interface{} `json:"errors"` Messages []interface{} `json:"messages"` Result CreateDNSRecordResult `json:"result"` }
CreateDNSRecordResponse is the JSON response for a DNS create request
type CreateDNSRecordResult ¶
type CreateDNSRecordResult struct { ID string `json:"id"` Type string `json:"type"` Name string `json:"name"` Content string `json:"content"` Proxiable bool `json:"proxiable"` Proxied bool `json:"proxied"` TTL uint `json:"ttl"` Locked bool `json:"locked"` ZoneID string `json:"zone_id"` ZoneName string `json:"zone_name"` CreatedOn string `json:"created_on"` ModifiedOn string `json:"modified_on"` Data interface{} `json:"data"` }
CreateDNSRecordResult is the result of the response for the DNS create request
type Cred ¶
type Cred struct {
// contains filtered or unexported fields
}
Cred contains the credentials used to authenticate with the cloudflare API.
func NewCred ¶
NewCred creates a new credential structure used to authenticate with the cloudflare service.
type DNS ¶
type DNS struct { Cred // contains filtered or unexported fields }
DNS is the cloudflare package main access class. Initiate an instance of this class to access the clouldflare APIs.
func (*DNS) ClearSRVRecord ¶
func (d *DNS) ClearSRVRecord(ctx context.Context, name string, target string, service string, protocol string) error
ClearSRVRecord clears the DNS SRV record to the given content.
func (*DNS) CreateDNSRecord ¶
func (d *DNS) CreateDNSRecord(ctx context.Context, recordType string, name string, content string, ttl uint, priority uint, proxied bool) error
CreateDNSRecord creates the DNS record with the given content.
func (*DNS) CreateSRVRecord ¶
func (d *DNS) CreateSRVRecord(ctx context.Context, name string, target string, ttl uint, priority uint, port uint, service string, protocol string, weight uint) error
CreateSRVRecord creates the DNS record with the given content.
func (*DNS) DeleteDNSRecord ¶
DeleteDNSRecord deletes a single DNS entry
func (*DNS) ExportZone ¶
ExportZone exports the zone into a BIND config bytes array
func (*DNS) ListDNSRecord ¶
func (d *DNS) ListDNSRecord(ctx context.Context, recordType string, name string, content string, order string, direction string, match string) ([]DNSRecordResponseEntry, error)
ListDNSRecord list the dns records that matches the given parameters.
func (*DNS) SetDNSRecord ¶
func (d *DNS) SetDNSRecord(ctx context.Context, recordType string, name string, content string, ttl uint, priority uint, proxied bool) error
SetDNSRecord sets the DNS record to the given content.
func (*DNS) SetSRVRecord ¶
func (d *DNS) SetSRVRecord(ctx context.Context, name string, target string, ttl uint, priority uint, port uint, service string, protocol string, weight uint) error
SetSRVRecord sets the DNS SRV record to the given content.
type DNSRecordResponseEntry ¶
type DNSRecordResponseEntry struct { ID string `json:"id"` Type string `json:"type"` Name string `json:"name"` Content string `json:"content"` Proxiable bool `json:"proxiable"` Proxied bool `json:"proxied"` TTL int `json:"ttl"` Priority int `json:"priority"` Locked bool `json:"locked"` ZoneID string `json:"zone_id"` ZoneName string `json:"zone_name"` ModifiedOn string `json:"modified_on"` CreatedOn string `json:"created_on"` }
DNSRecordResponseEntry represent a single returned DNS record entry
type DNSRecordResponseResultInfo ¶
type DNSRecordResponseResultInfo struct { Page int `json:"page"` PerPage int `json:"per_page"` TotalPages int `json:"total_pages"` Count int `json:"count"` TotalCount int `json:"total_count"` }
DNSRecordResponseResultInfo is paging status for the returned JSON structure ListDNSRecordResponse
type DeleteDNSRecordResponse ¶
type DeleteDNSRecordResponse struct { Success bool `json:"success"` Errors []interface{} `json:"errors"` Messages []interface{} `json:"messages"` Result DeleteDNSRecordResult `json:"result"` }
DeleteDNSRecordResponse is the JSON response for a DNS delete request
type DeleteDNSRecordResult ¶
type DeleteDNSRecordResult struct {
ID string `json:"id"`
}
DeleteDNSRecordResult is the JSON result for a DNS delete request
type GetZonesResult ¶
type GetZonesResult struct { Success bool `json:"success"` Errors []interface{} `json:"errors"` Messages []interface{} `json:"messages"` Result []GetZonesResultItem `json:"result"` ResultInfo GetZonesResultPage `json:"result_info"` }
GetZonesResult is the JSON response for a DNS create request
type GetZonesResultItem ¶
type GetZonesResultItem struct { ID string `json:"id"` Name string `json:"name"` Status string `json:"status"` Paused bool `json:"paused"` Type string `json:"type"` DevelopmentMode int `json:"development_mode"` NameServers []string `json:"name_servers"` OriginalNameServers []string `json:"original_name_servers"` }
GetZonesResultItem is the result of the response for the DNS create request
type GetZonesResultPage ¶
type GetZonesResultPage struct { Page int `json:"page"` PerPage int `json:"per_page"` TotalPages int `json:"total_pages"` Count int `json:"count"` TotalCount int `json:"total_count"` }
GetZonesResultPage is the result of the response for the DNS create request
type ListDNSRecordError ¶
ListDNSRecordError is the JSON data structure for a single error during list dns records request
type ListDNSRecordResponse ¶
type ListDNSRecordResponse struct { Result []DNSRecordResponseEntry `json:"result"` ResultInfo DNSRecordResponseResultInfo `json:"result_info"` Errors []ListDNSRecordError `json:"errors"` Messages []interface{} `json:"messages"` }
ListDNSRecordResponse is the JSON data structure returned when we list the dns records