internal

package
v4.18.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: MIT Imports: 9 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
	// 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(ctx context.Context, record DNSRecord) error

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

func (*Client) DeleteRecord

func (c *Client) DeleteRecord(ctx context.Context, recordID string) error

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

func (*Client) GetTxtRecord

func (c *Client) GetTxtRecord(ctx context.Context, name, value, zoneID string) (*DNSRecord, error)

GetTxtRecord gets a TXT record.

func (*Client) GetZoneID

func (c *Client) GetZoneID(ctx context.Context, 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 Meta

type Meta struct {
	Pagination Pagination `json:"pagination,omitempty"`
}

Meta response metadata.

type Pagination

type Pagination struct {
	Page         int `json:"page,omitempty" url:"page"`
	PerPage      int `json:"per_page,omitempty" url:"per_page"`
	LastPage     int `json:"last_page,omitempty" url:"-"`
	TotalEntries int `json:"total_entries,omitempty" url:"-"`
}

Pagination information about pagination.

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"`
	Meta  Meta   `json:"meta,omitempty"`
}

Zones a set of DNS zones.

Jump to

Keyboard shortcuts

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