internal

package
v4.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	HTTPClient *http.Client
	BaseURL    string
	// contains filtered or unexported fields
}

Client the Hetzner client.

func NewClient

func NewClient(apiKey string) *Client

NewClient Creates a new Hetzner client.

func (*Client) CreateRecord

func (c *Client) CreateRecord(record DNSRecord) error

CreateRecord creates a DNS record. https://dns.hetzner.com/api-docs#operation/CreateRecord

func (*Client) DeleteRecord

func (c *Client) DeleteRecord(recordID string) error

DeleteRecord deletes a DNS record. https://dns.hetzner.com/api-docs#operation/DeleteRecord

func (*Client) GetTxtRecord

func (c *Client) GetTxtRecord(name, value, zoneID string) (*DNSRecord, error)

GetTxtRecord gets a TXT record.

func (*Client) GetZoneID

func (c *Client) GetZoneID(domain string) (string, error)

GetZoneID gets the zone ID for a domain.

type DNSRecord

type DNSRecord struct {
	ID       string `json:"id,omitempty"`
	Name     string `json:"name,omitempty"`
	Type     string `json:"type,omitempty"`
	Value    string `json:"value"`
	Priority int    `json:"priority,omitempty"`
	TTL      int    `json:"ttl,omitempty"`
	ZoneID   string `json:"zone_id,omitempty"`
}

DNSRecord a DNS record.

type DNSRecords

type DNSRecords struct {
	Records []DNSRecord `json:"records"`
}

DNSRecords a set of DNS record.

type Zone

type Zone struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

Zone a DNS zone.

type Zones

type Zones struct {
	Zones []Zone `json:"zones"`
}

Zones a set of DNS zones.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL