Documentation ¶
Overview ¶
Package hosttech implements methods for manipulating Hosttech.ch DNS records with the libdns interfaces. Manipulation is achieved with the Hosttech API at https://api.ns1.hosttech.eu/api/documentation/#/.
Index ¶
- func RemoveTrailingDot(input string) string
- type AAAARecord
- type ARecord
- type ApiError
- type Base
- type CNAMERecord
- type HosttechListResponseWrapper
- type HosttechRecord
- type HosttechRecordWrapper
- type HosttechSingleResponseWrapper
- type HosttechZone
- type HosttechZoneListResponseWrapper
- type MXRecord
- type NSRecord
- type Provider
- func (p *Provider) AppendRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
- func (p *Provider) DeleteRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
- func (p *Provider) GetRecords(ctx context.Context, zone string) ([]libdns.Record, error)
- func (p *Provider) ListZones(ctx context.Context) ([]libdns.Zone, error)
- func (p *Provider) SetRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
- type TLSARecord
- type TXTRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RemoveTrailingDot ¶ added in v1.0.3
Types ¶
type AAAARecord ¶
type AAAARecord struct { Base Name string `json:"name,omitempty"` IPV6 string `json:"ipv6,omitempty"` }
AAAARecord is an implementation of the AAAA record type
type ARecord ¶
type ARecord struct { Base Name string `json:"name,omitempty"` IPV4 string `json:"ipv4,omitempty"` }
ARecord is an implementation of the A record type
type Base ¶
type Base struct { Id int `json:"id,omitempty"` Type string `json:"type,omitempty"` TTL int `json:"ttl,omitempty"` Comment string `json:"comment,omitempty"` }
Base holds all the values that are present in each record
type CNAMERecord ¶
type CNAMERecord struct { Base Name string `json:"name,omitempty"` Cname string `json:"cname,omitempty"` }
CNAMERecord is an implementation of the CNAME record type
type HosttechListResponseWrapper ¶
type HosttechListResponseWrapper struct {
Data []HosttechRecordWrapper `json:"data"`
}
type HosttechRecord ¶
type HosttechRecord interface {
// contains filtered or unexported methods
}
HosttechRecord must be implemented by each different type of record representation from the Hosttech.ch API, to allow a transformation from and to libdns.record.
func LibdnsRecordToHosttechRecordWrapper ¶
func LibdnsRecordToHosttechRecordWrapper(record libdns.Record) (HosttechRecord, error)
type HosttechRecordWrapper ¶
type HosttechRecordWrapper struct {
// contains filtered or unexported fields
}
func (*HosttechRecordWrapper) UnmarshalJSON ¶
func (h *HosttechRecordWrapper) UnmarshalJSON(b []byte) error
type HosttechSingleResponseWrapper ¶
type HosttechSingleResponseWrapper struct {
Data HosttechRecordWrapper `json:"data"`
}
type HosttechZone ¶ added in v1.0.4
type HosttechZone struct { Id uint `json:"id,omitempty"` Name string `json:"name,omitempty"` Email string `json:"email,omitempty"` TTL uint32 `json:"ttl,omitempty"` Nameserver string `json:"nameserver,omitempty"` DNSSEC bool `json:"dnssec,omitempty"` DNSSECEmail string `json:"dnssec_email,omitempty"` }
HosttechZone is an implementation of the zone without records
type HosttechZoneListResponseWrapper ¶ added in v1.0.4
type HosttechZoneListResponseWrapper struct {
Data []HosttechZone `json:"data"`
}
type MXRecord ¶
type MXRecord struct { Base Name string `json:"name,omitempty"` OwnerName string `json:"ownername,omitempty"` Pref uint `json:"pref,omitempty"` }
MXRecord is an implementation of the MX record type
type NSRecord ¶
type NSRecord struct { Base OwnerName string `json:"ownername,omitempty"` TargetName string `json:"targetname,omitempty"` }
NSRecord is an implementation of the NS record type
type Provider ¶
type Provider struct {
APIToken string `json:"api_token,omitempty"`
}
Provider facilitates DNS record manipulation with Hosttech.ch.
func (*Provider) AppendRecords ¶
func (p *Provider) AppendRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
AppendRecords adds records to the zone. It returns all records that were added. If an error occurs while records are being added, the already successfully added records will be returned along with an error.
func (*Provider) DeleteRecords ¶
func (p *Provider) DeleteRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
DeleteRecords deletes the records from the zone. It returns the records that were deleted. If an error occurs while records are being deleted, the already successfully deleted records will be returned along with an error.
func (*Provider) GetRecords ¶
GetRecords lists all the records in the zone.
type TLSARecord ¶
type TLSARecord struct { Base Name string `json:"name,omitempty"` Text string `json:"text,omitempty"` }
TLSARecord is an implementation of the TLSA record type