Documentation
¶
Overview ¶
Package dns1cloud implements methods for API of 1Cloud's DNS hosting
Index ¶
- type DNS1Cloud
- func (c *DNS1Cloud) AddRecord(ctx context.Context, domainID uint64, record Record) (Record, error)
- func (c *DNS1Cloud) DeleteRecord(ctx context.Context, domainID uint64, recordID uint64) error
- func (c *DNS1Cloud) GetDomain(ctx context.Context, domainID uint64) (Domain, error)
- func (c *DNS1Cloud) GetRecord(ctx context.Context, recordID uint64) (Record, error)
- func (c *DNS1Cloud) List(ctx context.Context) ([]Domain, error)
- func (c *DNS1Cloud) UpdateRecord(ctx context.Context, domainID uint64, record Record) (Record, error)
- type DateTime
- type Domain
- type OptFunc
- type Record
- type RecordType
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DNS1Cloud ¶
type DNS1Cloud struct {
// contains filtered or unexported fields
}
DNS1Cloud represents a client for API of 1Cloud's DNS hosting
func (*DNS1Cloud) AddRecord ¶
func (c *DNS1Cloud) AddRecord( ctx context.Context, domainID uint64, record Record, ) (Record, error)
AddRecord adds record to domain
func (*DNS1Cloud) DeleteRecord ¶
DeleteRecord deletes record from domain
type DateTime ¶
DateTime is a wrapper for unmarshaling time from JSON
func (*DateTime) UnmarshalJSON ¶
UnmarshalJSON sets time from JSON bytes
type Domain ¶
type Domain struct {
ID uint64 `json:"ID"`
Name string `json:"Name"`
TechName string `json:"TechName"`
State State `json:"State"`
DateCreate DateTime `json:"DateCreate"`
IsDelegate bool `json:"IsDelegate"`
LinkedRecords []Record `json:"LinkedRecords"`
}
Domain represents domain
type OptFunc ¶
type OptFunc func(*DNS1Cloud)
OptFunc is type for option function
func WithApiHost ¶
WithApiHost is option function for setting API host
func WithHTTPClient ¶
WithHTTPClient is option function for setting HTTP client
type Record ¶
type Record struct {
ID uint64 `json:"ID"`
TypeRecord RecordType `json:"TypeRecord"`
IP string `json:"IP"`
HostName string `json:"HostName"`
Priority string `json:"Priority"`
Text string `json:"Text"`
MnemonicName string `json:"MnemonicName"`
ExtHostName string `json:"ExtHostName"`
Weight string `json:"Weight"`
Port string `json:"Port"`
Target string `json:"Target"`
Proto string `json:"Proto"`
Service string `json:"Service"`
TTL uint32 `json:"TTL"`
State State `json:"State"`
DateCreate DateTime `json:"DateCreate"`
CanonicalDescription string `json:"CanonicalDescription"`
}
Domain represents record of domain
type RecordType ¶
type RecordType uint8
RecordType is a type of record
const ( // RecordTypeA is a type "A" RecordTypeA RecordType = iota // RecordTypeAAAA is a type "AAAA" RecordTypeAAAA // RecordTypeMX is a type "MX" RecordTypeMX // RecordTypeCNAME is a type "CNAME" RecordTypeCNAME // RecordTypeTXT is a type "TXT" RecordTypeTXT // RecordTypeNS is a type "NS" RecordTypeNS // RecordTypeSRV is a type "SRV" RecordTypeSRV )
func (*RecordType) UnmarshalJSON ¶
func (r *RecordType) UnmarshalJSON(b []byte) error
UnmarshalJSON sets record type from JSON bytes
Click to show internal directories.
Click to hide internal directories.