Documentation
¶
Index ¶
- func BearerAuth(token string) func() authHeader
- func ContentFromValue(recordType, content string) []any
- func PermanentAPIKeyAuth(token string) func() authHeader
- type APIError
- type AddZone
- type AddZoneOpt
- type Client
- func (c *Client) AddZoneRRSet(ctx context.Context, zone, recordName, recordType string, ...) error
- func (c *Client) AllZones(ctx context.Context, nameFilters []string) ([]Zone, error)
- func (c *Client) AllZonesWithRecords(ctx context.Context, nameFilters []string) ([]Zone, error)
- func (c *Client) CreateNetworkMapping(ctx context.Context, mapping NetworkMappingRequest) (uint64, error)
- func (c *Client) CreateRRSet(ctx context.Context, zone, name, recordType string, record RRSet) error
- func (c *Client) CreateZone(ctx context.Context, addZone AddZone) (uint64, error)
- func (c *Client) DNSSecDS(ctx context.Context, zone string) (DNSSecDS, error)
- func (c *Client) DeleteNetworkMapping(ctx context.Context, id uint64) error
- func (c *Client) DeleteRRSet(ctx context.Context, zone, name, recordType string) error
- func (c *Client) DeleteRRSetRecord(ctx context.Context, zone, name, recordType string, contents ...string) error
- func (c *Client) DeleteZone(ctx context.Context, name string) error
- func (c *Client) DisableZone(ctx context.Context, name string) error
- func (c *Client) EnableZone(ctx context.Context, name string) error
- func (c *Client) GetNetworkMapping(ctx context.Context, id uint64) (*NetworkMappingResponse, error)
- func (c *Client) GetNetworkMappingByName(ctx context.Context, name string) (*NetworkMappingResponse, error)
- func (c *Client) ImportZone(ctx context.Context, name, content string) (ImportZoneResponse, error)
- func (c *Client) ListNetworkMappings(ctx context.Context, params NetworkMappingsParams) (*ListNetworkMappingResponse, error)
- func (c *Client) RRSet(ctx context.Context, zone, name, recordType string, limit, offset int) (RRSet, error)
- func (c *Client) ToggleDnssec(ctx context.Context, zone string, enable bool) (DNSSecDS, error)
- func (c *Client) UpdateNetworkMapping(ctx context.Context, id uint64, mapping NetworkMappingRequest) error
- func (c *Client) UpdateRRSet(ctx context.Context, zone, name, recordType string, record RRSet) error
- func (c *Client) UpdateZone(ctx context.Context, name string, updateZone AddZone) (uint64, error)
- func (c *Client) Zone(ctx context.Context, name string) (Zone, error)
- func (c *Client) ZoneNameservers(ctx context.Context, name string) ([]string, error)
- func (c *Client) Zones(ctx context.Context, filters ...func(zone *ZonesFilter)) ([]Zone, error)
- func (c *Client) ZonesWithParam(ctx context.Context, param ZonesParam) (res ListZones, err error)
- func (c *Client) ZonesWithRecords(ctx context.Context, filters ...func(zone *ZonesFilter)) ([]Zone, error)
- type CreateNetworkMappingResponse
- type CreateResponse
- type DNSSecDS
- type Dynamic
- type FailoverHttpCheck
- type FailoverIcmpCheck
- type FailoverTcpUdpCheck
- type IPNet
- type ImportZone
- type ImportZoneResponse
- type ImportedStats
- type ListNetworkMappingResponse
- type ListZones
- type MappingEntry
- type NetworkMappingRequest
- type NetworkMappingResponse
- type NetworkMappingsParams
- type RRSet
- func (rr *RRSet) AddFilter(filters ...RecordFilter) *RRSet
- func (r *RRSet) SetMetaAsn(asns []int) *RRSet
- func (r *RRSet) SetMetaBackup(backup bool) *RRSet
- func (r *RRSet) SetMetaContinents(continents []string) *RRSet
- func (r *RRSet) SetMetaCountries(countries []string) *RRSet
- func (r *RRSet) SetMetaFailover(failover map[string]any) *RRSet
- func (r *RRSet) SetMetaFailoverHttp(check FailoverHttpCheck) *RRSet
- func (r *RRSet) SetMetaFailoverIcmp(check FailoverIcmpCheck) *RRSet
- func (r *RRSet) SetMetaFailoverTcpUdp(check FailoverTcpUdpCheck) *RRSet
- func (r *RRSet) SetMetaFallback(fallback bool) *RRSet
- func (r *RRSet) SetMetaGeodnsLink(link string) *RRSet
- func (r *RRSet) SetMetaIP(ip string) *RRSet
- func (r *RRSet) SetMetaLatLong(lat, long float64) *RRSet
- func (r *RRSet) SetMetaNotes(notes string) *RRSet
- func (r *RRSet) SetMetaWeight(weight float64) *RRSet
- type RRSetMeta
- func NewRRSetMetaFailoverFromMap(failover map[string]any) *RRSetMeta
- func NewRRSetMetaGeodnsLink(link string) *RRSetMeta
- func NewRRSetMetaMetaFailoverFromHttp(failover FailoverHttpCheck) *RRSetMeta
- func NewRRSetMetaMetaFailoverFromIcmp(failover FailoverIcmpCheck) *RRSetMeta
- func NewRRSetMetaMetaFailoverFromTcpUdp(failover FailoverTcpUdpCheck) *RRSetMeta
- type RRSets
- type RRSetsAmount
- type RecordFilter
- type RecordType
- type RecordTypeAny
- type RecordTypeCAA
- type RecordTypeHTTPS_SCVB
- type RecordTypeMX
- type RecordTypeSRV
- type ResourceMeta
- func NewResourceMetaAsn(asn ...uint64) ResourceMeta
- func NewResourceMetaBackup() ResourceMeta
- func NewResourceMetaCidrLabels(cidrLabels map[string]int) ResourceMeta
- func NewResourceMetaContinents(continents ...string) ResourceMeta
- func NewResourceMetaCountries(countries ...string) ResourceMeta
- func NewResourceMetaDefault() ResourceMeta
- func NewResourceMetaFallback() ResourceMeta
- func NewResourceMetaIP(ips ...string) ResourceMeta
- func NewResourceMetaLatLong(latlong string) ResourceMeta
- func NewResourceMetaNotes(notes ...string) ResourceMeta
- func NewResourceMetaWeight(weight int) ResourceMeta
- type ResourceRecord
- type Zone
- type ZoneRecord
- type ZonesFilter
- type ZonesParam
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContentFromValue ¶
ContentFromValue convertor from flat value to valid for api
func PermanentAPIKeyAuth ¶
func PermanentAPIKeyAuth(token string) func() authHeader
PermanentAPIKeyAuth by header
Types ¶
type AddZone ¶
type AddZone struct {
Contact string `json:"contact,omitempty"`
Enabled bool `json:"enabled,omitempty"`
Expiry uint64 `json:"expiry,omitempty"`
Meta map[string]interface{} `json:"meta,omitempty"`
Name string `json:"name"`
NxTTL uint64 `json:"nx_ttl,omitempty"`
PrimaryServer string `json:"primary_server,omitempty"`
Refresh uint64 `json:"refresh,omitempty"`
Retry uint64 `json:"retry,omitempty"`
Serial uint64 `json:"serial,omitempty"`
}
AddZone dto to create new zone
type AddZoneOpt ¶
type AddZoneOpt func(*RRSet)
AddZoneOpt setup RRSet
func WithFilters ¶
func WithFilters(filters ...RecordFilter) AddZoneOpt
WithFilters add filters to RRSet
type Client ¶
type Client struct {
HTTPClient *http.Client
UserAgent string
BaseURL *url.URL
Debug bool
// contains filtered or unexported fields
}
Client for DNS API.
func (*Client) AddZoneRRSet ¶
func (c *Client) AddZoneRRSet(ctx context.Context, zone, recordName, recordType string, values []ResourceRecord, ttl int, opts ...AddZoneOpt) error
AddZoneRRSet create or extend resource record.
func (*Client) AllZonesWithRecords ¶ added in v0.2.8
AllZonesWithRecords gets all zones with records information.
func (*Client) CreateNetworkMapping ¶ added in v0.3.1
func (c *Client) CreateNetworkMapping(ctx context.Context, mapping NetworkMappingRequest) (uint64, error)
CreateNetworkMapping creates a new network mapping. https://apidocs.gcore.com/dns#tag/NetworkMappings/operation/CreateNetworkMapping
func (*Client) CreateRRSet ¶
func (c *Client) CreateRRSet(ctx context.Context, zone, name, recordType string, record RRSet) error
CreateRRSet https://apidocs.gcore.com/dns#tag/rrsets/operation/CreateRRSet
func (*Client) CreateZone ¶
CreateZone adds new zone. https://apidocs.gcore.com/dns#tag/zones/operation/CreateZone
func (*Client) DNSSecDS ¶ added in v0.2.9
DNSSecDS https://api.gcore.com/docs/dns#tag/DNSSEC/operation/GetDNSSECDS
func (*Client) DeleteNetworkMapping ¶ added in v0.3.1
DeleteNetworkMapping deletes a network mapping by ID. https://apidocs.gcore.com/dns#tag/NetworkMappings/operation/DeleteNetworkMapping
func (*Client) DeleteRRSet ¶
DeleteRRSet removes RRSet type records. https://apidocs.gcore.com/dns#tag/rrsets/operation/DeleteRRSet
func (*Client) DeleteRRSetRecord ¶
func (c *Client) DeleteRRSetRecord(ctx context.Context, zone, name, recordType string, contents ...string) error
DeleteRRSetRecord removes RRSet record.
func (*Client) DeleteZone ¶
DeleteZone gets zone information. https://apidocs.gcore.com/dns#tag/zones/operation/DeleteZone
func (*Client) DisableZone ¶ added in v0.3.2
DisableZone disables a DNS zone. https://apidocs.gcore.com/dns#tag/zones/operation/DisableZone
func (*Client) EnableZone ¶ added in v0.3.2
EnableZone enables a DNS zone. https://apidocs.gcore.com/dns#tag/zones/operation/EnableZone
func (*Client) GetNetworkMapping ¶ added in v0.3.1
GetNetworkMapping gets a network mapping by ID. https://apidocs.gcore.com/dns#tag/NetworkMappings/operation/GetNetworkMapping
func (*Client) GetNetworkMappingByName ¶ added in v0.3.1
func (c *Client) GetNetworkMappingByName(ctx context.Context, name string) (*NetworkMappingResponse, error)
GetNetworkMappingByName gets a network mapping by name. https://apidocs.gcore.com/dns#tag/NetworkMappings/operation/NetworkMappingByName
func (*Client) ImportZone ¶ added in v0.3.2
ImportZone imports records into a DNS zone. https://apidocs.gcore.com/dns#tag/zones/operation/ImportZone
func (*Client) ListNetworkMappings ¶ added in v0.3.1
func (c *Client) ListNetworkMappings(ctx context.Context, params NetworkMappingsParams) (*ListNetworkMappingResponse, error)
ListNetworkMappings lists network mappings. https://apidocs.gcore.com/dns#tag/NetworkMappings/operation/ListNetworkMapping
func (*Client) RRSet ¶
func (c *Client) RRSet(ctx context.Context, zone, name, recordType string, limit, offset int) (RRSet, error)
RRSet gets RRSet item. https://apidocs.gcore.com/dns#tag/rrsets/operation/RRSet
func (*Client) ToggleDnssec ¶ added in v0.2.9
ToggleDnssec https://api.gcore.com/docs/dns#tag/DNSSEC/operation/ToggleDNSSEC
func (*Client) UpdateNetworkMapping ¶ added in v0.3.1
func (c *Client) UpdateNetworkMapping(ctx context.Context, id uint64, mapping NetworkMappingRequest) error
UpdateNetworkMapping updates a network mapping. https://apidocs.gcore.com/dns#tag/NetworkMappings/operation/UpdateNetworkMapping
func (*Client) UpdateRRSet ¶
func (c *Client) UpdateRRSet(ctx context.Context, zone, name, recordType string, record RRSet) error
UpdateRRSet https://apidocs.gcore.com/dns#tag/rrsets/operation/UpdateRRSet
func (*Client) UpdateZone ¶ added in v0.3.2
func (*Client) Zone ¶
Zone gets zone information. https://apidocs.gcore.com/dns#tag/zones/operation/Zone
func (*Client) ZoneNameservers ¶ added in v0.2.4
ZoneNameservers gets zone nameservers.
func (*Client) Zones ¶
Zones gets first 100 zones. https://apidocs.gcore.com/dns#tag/zones/operation/Zones
func (*Client) ZonesWithParam ¶ added in v0.2.7
ZonesWithParam gets zones with params.
func (*Client) ZonesWithRecords ¶
func (c *Client) ZonesWithRecords(ctx context.Context, filters ...func(zone *ZonesFilter)) ([]Zone, error)
ZonesWithRecords gets first 100 zones with records information.
type CreateNetworkMappingResponse ¶ added in v0.3.1
type CreateNetworkMappingResponse struct {
ID uint64 `json:"id"`
}
CreateNetworkMappingResponse is the response for creating a network mapping.
type CreateResponse ¶
type CreateResponse struct {
ID uint64 `json:"id,omitempty"`
Error string `json:"error,omitempty"`
}
CreateResponse dto to create new zone
type DNSSecDS ¶ added in v0.2.9
type DNSSecDS struct {
Algorithm string `json:"algorithm"`
Digest string `json:"digest"`
DigestAlgorithm string `json:"digest_algorithm"`
DigestType string `json:"digest_type"`
Ds string `json:"ds"`
Flags int `json:"flags"`
KeyTag int `json:"key_tag"`
KeyType string `json:"key_type"`
PublicKey string `json:"public_key"`
Uuid string `json:"uuid"`
}
DNSSecDS dto describe DS records that returned from API on DNSSec requests
type FailoverHttpCheck ¶ added in v0.2.7
type FailoverHttpCheck struct {
Protocol string `json:"protocol"` // HTTP
Port uint16 `json:"port"`
Frequency uint16 `json:"frequency"`
Timeout uint16 `json:"timeout"`
// HTTP only
Method string `json:"method,omitempty"` // GET, POST, PUT, DELETE, PATCH
URL string `json:"url,omitempty"` // without / prefix
Host *string `json:"host,omitempty"`
HttpStatusCode *uint16 `json:"http_status_code,omitempty"` // 100-599
Regexp *string `json:"regexp,omitempty"`
TLS bool `json:"tls"`
}
FailoverHttpCheck for failover meta property with protocol=HTTP
type FailoverIcmpCheck ¶ added in v0.2.7
type FailoverIcmpCheck struct {
Protocol string `json:"protocol"` // ICMP
Port uint16 `json:"port"`
Frequency uint16 `json:"frequency"`
Timeout uint16 `json:"timeout"`
}
FailoverIcmpCheck for failover meta property with protocol=ICMP
type FailoverTcpUdpCheck ¶ added in v0.2.7
type FailoverTcpUdpCheck struct {
Protocol string `json:"protocol"` // TCP or UDP
Port uint16 `json:"port"`
Frequency uint16 `json:"frequency"`
Timeout uint16 `json:"timeout"`
// TCP/UDP only
Command *string `json:"command"` // bytes to sent
Regexp *string `json:"regexp,omitempty"`
}
FailoverTcpUdpCheck for failover meta property with protocol=TCP|UDP
type IPNet ¶ added in v0.3.1
IPNet represents a validated CIDR network address.
func (IPNet) MarshalJSON ¶ added in v0.3.1
MarshalJSON implements the json.Marshaler interface to convert IPNet to a string.
func (*IPNet) UnmarshalJSON ¶ added in v0.3.1
UnmarshalJSON implements the json.Unmarshaler interface to convert a string to IPNet.
type ImportZone ¶ added in v0.3.2
type ImportZone struct {
Content string `json:"content"`
}
type ImportZoneResponse ¶ added in v0.3.2
type ImportZoneResponse struct {
Imported ImportedStats `json:"imported"`
Success bool `json:"success"`
Warnings map[string]map[string]string `json:"warnings,omitempty"`
}
ImportZoneResponse represents the response from importing a zone
type ImportedStats ¶ added in v0.3.2
type ImportedStats struct {
QType int `json:"qtype"`
ResourceRecords int `json:"resource_records"`
RRSets int `json:"rrsets"`
SkippedResourceRecords int `json:"skipped_resource_records"`
}
ImportedStats represents the statistics of imported records
type ListNetworkMappingResponse ¶ added in v0.3.1
type ListNetworkMappingResponse struct {
NetworkMappings []NetworkMappingResponse `json:"network_mappings"`
TotalAmount int `json:"total_amount"`
}
ListNetworkMappingResponse is the response for listing network mappings.
type ListZones ¶
type ListZones struct {
Zones []Zone `json:"zones"`
TotalAmount int `json:"total_amount"`
Error string `json:"error,omitempty"`
}
ListZones dto to read list of zones from API
type MappingEntry ¶ added in v0.3.1
type MappingEntry struct {
CIDR4 []IPNet `json:"cidr4,omitempty"`
CIDR6 []IPNet `json:"cidr6,omitempty"`
Tags []string `json:"tags,omitempty"`
}
MappingEntry defines a set of CIDRs and their associated tags.
type NetworkMappingRequest ¶ added in v0.3.1
type NetworkMappingRequest struct {
Name string `json:"name"`
Mapping []MappingEntry `json:"mapping"`
}
NetworkMapping is the core object representing a network mapping.
type NetworkMappingResponse ¶ added in v0.3.1
type NetworkMappingResponse struct {
ID uint64 `json:"id"`
Name string `json:"name"`
Mapping []MappingEntry `json:"mapping"`
}
type NetworkMappingsParams ¶ added in v0.3.1
type RRSet ¶
type RRSet struct {
Type string `json:"type"`
TTL int `json:"ttl"`
Records []ResourceRecord `json:"resource_records"`
Filters []RecordFilter `json:"filters"`
Meta RRSetMeta `json:"meta"` // this one for failover, not Meta property inside Records
}
RRSet dto as part of zone info from API
func (*RRSet) AddFilter ¶
func (rr *RRSet) AddFilter(filters ...RecordFilter) *RRSet
AddFilter to RRSet
func (*RRSet) SetMetaBackup ¶ added in v0.2.7
SetMetaBackup
func (*RRSet) SetMetaContinents ¶ added in v0.2.7
SetMetaContinents
func (*RRSet) SetMetaCountries ¶ added in v0.2.7
SetMetaCountries
func (*RRSet) SetMetaFailover ¶ added in v0.2.7
SetMetaFailover
func (*RRSet) SetMetaFailoverHttp ¶ added in v0.2.7
func (r *RRSet) SetMetaFailoverHttp(check FailoverHttpCheck) *RRSet
SetMetaFailoverHttp for failover
func (*RRSet) SetMetaFailoverIcmp ¶ added in v0.2.7
func (r *RRSet) SetMetaFailoverIcmp(check FailoverIcmpCheck) *RRSet
SetMetaFailoverIcmp for ICMP failover
func (*RRSet) SetMetaFailoverTcpUdp ¶ added in v0.2.7
func (r *RRSet) SetMetaFailoverTcpUdp(check FailoverTcpUdpCheck) *RRSet
SetMetaFailoverTcpUdp for TCP/DUP failover
func (*RRSet) SetMetaFallback ¶ added in v0.2.7
SetMetaFallback
func (*RRSet) SetMetaGeodnsLink ¶ added in v0.2.7
SetMetaGeodnsLink
func (*RRSet) SetMetaLatLong ¶ added in v0.2.7
SetMetaLatLong
func (*RRSet) SetMetaNotes ¶ added in v0.2.7
SetMetaNotes
func (*RRSet) SetMetaWeight ¶ added in v0.2.7
SetMetaWeight
type RRSetMeta ¶ added in v0.2.7
func NewRRSetMetaFailoverFromMap ¶ added in v0.2.7
NewRRSetMetaFailoverFromMap for failover
func NewRRSetMetaGeodnsLink ¶ added in v0.2.7
func NewRRSetMetaMetaFailoverFromHttp ¶ added in v0.2.7
func NewRRSetMetaMetaFailoverFromHttp(failover FailoverHttpCheck) *RRSetMeta
NewRRSetMetaMetaFailoverFromHttp for failover
func NewRRSetMetaMetaFailoverFromIcmp ¶ added in v0.2.7
func NewRRSetMetaMetaFailoverFromIcmp(failover FailoverIcmpCheck) *RRSetMeta
NewRRSetMetaMetaFailoverFromIcmp for ICMP failover
func NewRRSetMetaMetaFailoverFromTcpUdp ¶ added in v0.2.7
func NewRRSetMetaMetaFailoverFromTcpUdp(failover FailoverTcpUdpCheck) *RRSetMeta
NewRRSetMetaMetaFailoverFromTcpUdp for TCP/DUP failover
type RRSetsAmount ¶ added in v0.3.2
type RecordFilter ¶
type RecordFilter struct {
Limit uint `json:"limit"`
Type string `json:"type"`
Strict bool `json:"strict"`
}
RecordFilter describe Filters in RRSet
func NewDefaultFilter ¶
func NewDefaultFilter(limit uint, strict bool) RecordFilter
NewDefaultFilter for RRSet
func NewFirstNFilter ¶
func NewFirstNFilter(limit uint, strict bool) RecordFilter
NewFirstNFilter for RRSet
func NewGeoDNSFilter ¶
func NewGeoDNSFilter(limit uint, strict bool) RecordFilter
NewGeoDNSFilter for RRSet
func NewGeoDistanceFilter ¶
func NewGeoDistanceFilter(limit uint, strict bool) RecordFilter
NewGeoDistanceFilter for RRSet
type RecordTypeHTTPS_SCVB ¶ added in v0.2.5
type RecordTypeHTTPS_SCVB string
RecordTypeHTTPS_SCVB as type of record
func (RecordTypeHTTPS_SCVB) ToContent ¶ added in v0.2.5
func (r RecordTypeHTTPS_SCVB) ToContent() (res []any)
ToContent convertor
type ResourceMeta ¶
type ResourceMeta struct {
// contains filtered or unexported fields
}
ResourceMeta for ResourceRecord
func NewResourceMetaAsn ¶
func NewResourceMetaAsn(asn ...uint64) ResourceMeta
NewResourceMetaAsn for asn meta
func NewResourceMetaBackup ¶ added in v0.2.7
func NewResourceMetaBackup() ResourceMeta
NewResourceMetaBackup for backup meta
func NewResourceMetaCidrLabels ¶ added in v0.3.3
func NewResourceMetaCidrLabels(cidrLabels map[string]int) ResourceMeta
func NewResourceMetaContinents ¶
func NewResourceMetaContinents(continents ...string) ResourceMeta
NewResourceMetaContinents for continents meta
func NewResourceMetaCountries ¶
func NewResourceMetaCountries(countries ...string) ResourceMeta
NewResourceMetaCountries for Countries meta
func NewResourceMetaDefault ¶
func NewResourceMetaDefault() ResourceMeta
NewResourceMetaDefault for default meta
func NewResourceMetaFallback ¶ added in v0.2.7
func NewResourceMetaFallback() ResourceMeta
NewResourceMetaFallback for fallback meta
func NewResourceMetaIP ¶
func NewResourceMetaIP(ips ...string) ResourceMeta
NewResourceMetaIP for ip meta
func NewResourceMetaLatLong ¶
func NewResourceMetaLatLong(latlong string) ResourceMeta
NewResourceMetaLatLong for lat long meta
func NewResourceMetaNotes ¶
func NewResourceMetaNotes(notes ...string) ResourceMeta
NewResourceMetaNotes for notes meta
func NewResourceMetaWeight ¶ added in v0.2.7
func NewResourceMetaWeight(weight int) ResourceMeta
NewResourceMetaWeight for fallback meta
type ResourceRecord ¶
type ResourceRecord struct {
Content []any `json:"content"`
Meta map[string]any `json:"meta"`
Enabled bool `json:"enabled"`
}
ResourceRecord dto describe records in RRSet
func (*ResourceRecord) AddMeta ¶
func (r *ResourceRecord) AddMeta(meta ResourceMeta) *ResourceRecord
AddMeta to ResourceRecord
func (ResourceRecord) ContentToString ¶
func (r ResourceRecord) ContentToString() string
ContentToString as short value example from: tls-ech.dev. 899 IN HTTPS 1 . ech=AEn+DQBFKwAgACABWIHUGj4u+PIggYXcR5JF0gYk3dCRioBW8uJq9H4mKAAIAAEAAQABAANAEnB1YmxpYy50bHMtZWNoLmRldgAA clickhouse.com. 899 IN HTTPS 1 . alpn="h3,h3-29,h2" ipv4hint=172.66.40.249,172.66.43.7 ipv6hint=2606:4700:3108::ac42:28f9,2606:4700:3108::ac42:2b07
func (*ResourceRecord) SetContent ¶
func (r *ResourceRecord) SetContent(recordType, val string) *ResourceRecord
SetContent to ResourceRecord
type Zone ¶
type Zone struct {
Name string `json:"name"`
ClientID uint64 `json:"client_id"`
Contact string `json:"contact"`
DNSSECEnabled bool `json:"dnssec_enabled"`
Expiry uint64 `json:"expiry"`
ID uint64 `json:"id,omitempty"`
Meta map[string]interface{} `json:"meta"`
NxTTL uint64 `json:"nx_ttl"`
PrimaryServer string `json:"primary_server"`
Records []ZoneRecord `json:"records"`
Refresh uint64 `json:"refresh"`
Retry uint64 `json:"retry"`
RRSetsAmount RRSetsAmount `json:"rrsets_amount"`
Serial uint64 `json:"serial"`
Status string `json:"status"`
}
Zone dto to read info from API
type ZoneRecord ¶
type ZoneRecord struct {
Name string `json:"name"`
Type string `json:"type"`
TTL uint32 `json:"ttl"`
ShortAnswers []string `json:"short_answers"`
}
ZoneRecord dto describe records in Zone
type ZonesParam ¶ added in v0.2.7
type ZonesParam struct {
Offset uint64
Limit uint64
OrderBy string
OrderDirection string
ID []uint64
ClientID []uint64
ResellerID []uint64
IAMResellerID []uint64
Name []string
CaseSensitive bool
ExactMatch bool
Enabled bool
Status string
Dynamic bool
Healthcheck bool
UpdatedAtFrom time.Time
UpdatedAtTo time.Time
}
ZonesParam parameter for ZonesWithParam method
offset integer <uint64> Amount of records to skip before beginning to write in response.
limit integer <uint64> Max number of records in response
order_by string Field name to sort by
order_direction string Enum: "asc" "desc"
Ascending or descending order id Array of integers <int64> [ items <int64 > ]
to pass several ids id=1&id=3&id=5... client_id Array of integers <int64> [ items <int64 > ]
to pass several client_ids client_id=1&client_id=3&client_id=5... reseller_id Array of integers <int64> [ items <int64 > ]
iam_reseller_id Array of integers <int64> [ items <int64 > ]
name Array of strings to pass several names name=first&name=second...
case_sensitive boolean
exact_match boolean
enabled boolean
status string
dynamic boolean Zones with dynamic RRsets
healthcheck boolean Zones with RRsets that have healthchecks
updated_at_from string <date-time>
updated_at_to string <date-time>