Documentation ¶
Index ¶
- type HCloudAnswerCreateRecords
- type HCloudAnswerDeleteRecord
- type HCloudAnswerDeleteZone
- type HCloudAnswerError
- type HCloudAnswerErrorString
- type HCloudAnswerGetRecord
- type HCloudAnswerGetRecords
- type HCloudAnswerGetZone
- type HCloudAnswerGetZonePlainText
- type HCloudAnswerGetZones
- type HCloudAnswerUpdateRecords
- type HCloudAnswerZoneValidate
- type HCloudClient
- func (d *HCloudClient) CreateRecord(record HCloudRecord) (HCloudAnswerGetRecord, error)
- func (d *HCloudClient) CreateRecordBulk(record []HCloudRecord) (HCloudAnswerCreateRecords, error)
- func (d *HCloudClient) CreateZone(zone HCloudZone) (HCloudAnswerGetZone, error)
- func (d *HCloudClient) DeleteRecord(ID string) (HCloudAnswerDeleteRecord, error)
- func (d *HCloudClient) DeleteZone(ID string) (HCloudAnswerDeleteZone, error)
- func (d *HCloudClient) ExportZoneToString(zoneID string) (HCloudAnswerGetZonePlainText, error)
- func (d *HCloudClient) GetRecord(ID string) (HCloudAnswerGetRecord, error)
- func (d *HCloudClient) GetRecords(params HCloudGetRecordsParams) (HCloudAnswerGetRecords, error)
- func (d *HCloudClient) GetZone(ID string) (HCloudAnswerGetZone, error)
- func (d *HCloudClient) GetZones(params HCloudGetZonesParams) (HCloudAnswerGetZones, error)
- func (d *HCloudClient) ImportZoneString(zoneID string, zonePlainText string) (HCloudAnswerGetZone, error)
- func (d *HCloudClient) UpdateRecord(record HCloudRecord) (HCloudAnswerGetRecord, error)
- func (d *HCloudClient) UpdateRecordBulk(record []HCloudRecord) (HCloudAnswerUpdateRecords, error)
- func (d *HCloudClient) UpdateZone(zone HCloudZone) (HCloudAnswerGetZone, error)
- func (d *HCloudClient) ValidateZoneString(zonePlainText string) (HCloudAnswerZoneValidate, error)
- type HCloudClientAdapter
- type HCloudError
- type HCloudGetRecordsParams
- type HCloudGetZonesParams
- type HCloudMeta
- type HCloudRecord
- type HCloudZone
- type RecordType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HCloudAnswerCreateRecords ¶
type HCloudAnswerCreateRecords struct { Records []HCloudRecord `json:"records,omitempty"` ValidRecords []HCloudRecord `json:"valid_records,omitempty"` InvalidRecords []HCloudRecord `json:"invalid_records,omitempty"` Error HCloudError }
type HCloudAnswerDeleteRecord ¶
type HCloudAnswerDeleteRecord struct {
Error HCloudError
}
type HCloudAnswerDeleteZone ¶
type HCloudAnswerDeleteZone struct {
Error HCloudError
}
type HCloudAnswerError ¶
type HCloudAnswerError struct {
Error HCloudError `json:"error,omitempty"`
}
sometime can be returned HCloudError
type HCloudAnswerErrorString ¶
type HCloudAnswerErrorString struct {
Error string `json:"error,omitempty"`
}
or plain string
type HCloudAnswerGetRecord ¶
type HCloudAnswerGetRecord struct { Record HCloudRecord `json:"record,omitempty"` Error HCloudError }
type HCloudAnswerGetRecords ¶
type HCloudAnswerGetRecords struct { Records []HCloudRecord `json:"records,omitempty"` Meta HCloudMeta `json:"meta,omitempty"` Error HCloudError }
type HCloudAnswerGetZone ¶
type HCloudAnswerGetZone struct { Zone HCloudZone `json:"zone,omitempty"` Error HCloudError `json:",omitempty"` }
type HCloudAnswerGetZonePlainText ¶
type HCloudAnswerGetZonePlainText struct { ZonePlainText string `json:"zone,omitempty"` Error HCloudError }
type HCloudAnswerGetZones ¶
type HCloudAnswerGetZones struct { Zones []HCloudZone `json:"zones,omitempty"` Meta HCloudMeta `json:"meta,omitempty"` Error HCloudError }
type HCloudAnswerUpdateRecords ¶
type HCloudAnswerUpdateRecords struct { Records []HCloudRecord `json:"records,omitempty"` InvalidRecords []HCloudRecord `json:"failed_records,omitempty"` Error HCloudError }
type HCloudAnswerZoneValidate ¶
type HCloudAnswerZoneValidate struct { ParsedRecords int `json:"parsed_records,omitempty"` ValidRecords []HCloudZone `json:"valid_records,omitempty"` Error HCloudError }
type HCloudClient ¶
func (*HCloudClient) CreateRecord ¶
func (d *HCloudClient) CreateRecord(record HCloudRecord) (HCloudAnswerGetRecord, error)
CreateRecord creates new single record. Accepts HCloudRecord with record to create, of cource no ID. Returns HCloudAnswerGetRecord with HCloudRecord and error.
func (*HCloudClient) CreateRecordBulk ¶
func (d *HCloudClient) CreateRecordBulk(record []HCloudRecord) (HCloudAnswerCreateRecords, error)
CreateRecordBulk creates many records at once. Accepts array of HCloudRecord, converts it to json and makes POST to Hetzner. Returns HCloudAnswerCreateRecords with arrays of HCloudRecord with whole list, valid and invalid, error.
func (*HCloudClient) CreateZone ¶
func (d *HCloudClient) CreateZone(zone HCloudZone) (HCloudAnswerGetZone, error)
CreateZone creates new single zone. Accepts HCloudZone with record to create, of cource no ID. Returns HCloudAnswerGetZone with HCloudZone and error.
func (*HCloudClient) DeleteRecord ¶
func (d *HCloudClient) DeleteRecord(ID string) (HCloudAnswerDeleteRecord, error)
DeleteRecord remove record by ID. Accepts single ID string. Returns HCloudAnswerDeleteRecord and error.
func (*HCloudClient) DeleteZone ¶
func (d *HCloudClient) DeleteZone(ID string) (HCloudAnswerDeleteZone, error)
DeleteZone remove zone by ID. Accepts single ID string. Returns HCloudAnswerDeleteZone with error.
func (*HCloudClient) ExportZoneToString ¶
func (d *HCloudClient) ExportZoneToString(zoneID string) (HCloudAnswerGetZonePlainText, error)
ExportZoneToString exports single zone from imported text. Accepts ID and zonePlainText strings. Returns HCloudAnswerGetZonePlainText with HCloudZone and error.
func (*HCloudClient) GetRecord ¶
func (d *HCloudClient) GetRecord(ID string) (HCloudAnswerGetRecord, error)
GetRecord retrieve one single record by ID. Accepts single ID of record. Returns HCloudAnswerGetRecord with HCloudRecord and error.
func (*HCloudClient) GetRecords ¶
func (d *HCloudClient) GetRecords(params HCloudGetRecordsParams) (HCloudAnswerGetRecords, error)
GetRecords retrieve all records of user. Accepts HCloudGetRecordsParams struct Returns HCloudAnswerGetRecords with array of HCloudRecord, Meta and error.
func (*HCloudClient) GetZone ¶
func (d *HCloudClient) GetZone(ID string) (HCloudAnswerGetZone, error)
GetZone retrieve one single zone by ID. Accepts zone ID string. Returns HCloudAnswerGetZone with HCloudZone and error
func (*HCloudClient) GetZones ¶
func (d *HCloudClient) GetZones(params HCloudGetZonesParams) (HCloudAnswerGetZones, error)
GetZones retrieve all zones of user. Accepts exact name as string, search name with partial name. Returns HCloudAnswerGetZones with array of HCloudZone, Meta and error.
func (*HCloudClient) ImportZoneString ¶
func (d *HCloudClient) ImportZoneString(zoneID string, zonePlainText string) (HCloudAnswerGetZone, error)
ImportZoneString imports single zone from imported text. Accepts ID and zonePlainText strings. Returns HCloudAnswerGetZone with HCloudZone and error.
func (*HCloudClient) UpdateRecord ¶
func (d *HCloudClient) UpdateRecord(record HCloudRecord) (HCloudAnswerGetRecord, error)
UpdateRecord makes update of single record by ID. Accepts HCloudRecord with fullfilled fields. Returns HCloudAnswerGetRecord with HCloudRecord and error.
func (*HCloudClient) UpdateRecordBulk ¶
func (d *HCloudClient) UpdateRecordBulk(record []HCloudRecord) (HCloudAnswerUpdateRecords, error)
UpdateRecordBulk updates many records at once. Accepts array of HCloudRecord, converting to json and makes PUT to Hetzner. Returns HCloudAnswerUpdateRecords with arrays of HCloudRecord with updated and failed, error.
func (*HCloudClient) UpdateZone ¶
func (d *HCloudClient) UpdateZone(zone HCloudZone) (HCloudAnswerGetZone, error)
UpdateZone makes update of single zone by ID. Accepts HCloudZone with fullfilled fields. Returns HCloudAnswerGetZone with HCloudZone and error.
func (*HCloudClient) ValidateZoneString ¶
func (d *HCloudClient) ValidateZoneString(zonePlainText string) (HCloudAnswerZoneValidate, error)
ValidateZoneString validate single zone from imported text. Accepts ID and zonePlainText strings. Returns HCloudAnswerZoneValidate with HCloudZone and error.
type HCloudClientAdapter ¶
type HCloudClientAdapter interface { GetZone(ID string) (HCloudAnswerGetZone, error) GetZones(params HCloudGetZonesParams) (HCloudAnswerGetZones, error) UpdateZone(zone HCloudZone) (HCloudAnswerGetZone, error) DeleteZone(ID string) (HCloudAnswerDeleteZone, error) CreateZone(zone HCloudZone) (HCloudAnswerGetZone, error) ImportZoneString(zoneID string, zonePlainText string) (HCloudAnswerGetZone, error) ExportZoneToString(zoneID string) (HCloudAnswerGetZonePlainText, error) ValidateZoneString(zonePlainText string) (HCloudAnswerZoneValidate, error) GetRecord(ID string) (HCloudAnswerGetRecord, error) GetRecords(params HCloudGetRecordsParams) (HCloudAnswerGetRecords, error) UpdateRecord(record HCloudRecord) (HCloudAnswerGetRecord, error) DeleteRecord(ID string) (HCloudAnswerDeleteRecord, error) CreateRecord(record HCloudRecord) (HCloudAnswerGetRecord, error) CreateRecordBulk(record []HCloudRecord) (HCloudAnswerCreateRecords, error) UpdateRecordBulk(record []HCloudRecord) (HCloudAnswerUpdateRecords, error) }
type HCloudError ¶
type HCloudError struct { Code int `json:"code,omitempty"` Message string `json:"message,omitempty"` }
Hetzner errors roundabout. Fuck you Hetzner.
type HCloudGetRecordsParams ¶
type HCloudGetZonesParams ¶
type HCloudMeta ¶
type HCloudRecord ¶
type HCloudZone ¶
type HCloudZone struct { ID string `json:"id,omitempty"` Created string `json:"created,omitempty"` Modified string `json:"modified,omitempty"` LegacyDNSHost string `json:"legacy_dns_host,omitempty"` LegacyNS []string `json:"legacy_ns,omitempty"` Name string `json:"name,omitempty"` NS []string `json:"ns,omitempty"` Owner string `json:"owner,omitempty"` Paused bool `json:"paused,omitempty"` Permission string `json:"permission,omitempty"` Project string `json:"project,omitempty"` Registrar string `json:"registrar,omitempty"` Status string `json:"status,omitempty"` TTL int `json:"ttl,omitempty"` Verified string `json:"verified,omitempty"` RecordsCount int `json:"records_count,omitempty"` IsSecondaryDNS bool `json:"is_secondary_dns,omitempty"` TXTverification struct { Name string `json:"name,omitempty"` Token string `json:"token,omitempty"` } `json:"txt_verification,omitempty"` }
type RecordType ¶
type RecordType string
RecordType supported by Hetzner
const ( A RecordType = "A" AAAA RecordType = "AAAA" CNAME RecordType = "CNAME" MX RecordType = "MX" NS RecordType = "NS" TXT RecordType = "TXT" RP RecordType = "RP" SOA RecordType = "SOA" HINFO RecordType = "HINFO" SRV RecordType = "SRV" DANE RecordType = "DANE" TLSA RecordType = "TLSA" DS RecordType = "DS" CAA RecordType = "CAA" )