internal

package
v4.13.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: MIT Imports: 10 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 Lua DNS API client.

func NewClient

func NewClient(apiUsername, apiToken string) *Client

NewClient creates a new Client.

func (*Client) CreateRecord

func (c *Client) CreateRecord(ctx context.Context, zone DNSZone, newRecord DNSRecord) (*DNSRecord, error)

CreateRecord creates a new record in a zone. https://luadns.com/api.html#create-a-record

func (*Client) DeleteRecord

func (c *Client) DeleteRecord(ctx context.Context, record *DNSRecord) error

DeleteRecord deletes a record. https://luadns.com/api.html#delete-a-record

func (*Client) ListZones

func (c *Client) ListZones(ctx context.Context) ([]DNSZone, error)

ListZones gets all the hosted zones. https://luadns.com/api.html#list-zones

type DNSRecord

type DNSRecord struct {
	ID      int    `json:"id,omitempty"`
	Name    string `json:"name,omitempty"`
	Type    string `json:"type,omitempty"`
	Content string `json:"content,omitempty"`
	TTL     int    `json:"ttl,omitempty"`
	ZoneID  int    `json:"zone_id,omitempty"`
}

DNSRecord a DNS record.

type DNSZone

type DNSZone struct {
	ID             int    `json:"id"`
	Name           string `json:"name,omitempty"`
	Synced         bool   `json:"synced,omitempty"`
	QueriesCount   int    `json:"queries_count,omitempty"`
	RecordsCount   int    `json:"records_count,omitempty"`
	AliasesCount   int    `json:"aliases_count,omitempty"`
	RedirectsCount int    `json:"redirects_count,omitempty"`
	ForwardsCount  int    `json:"forwards_count,omitempty"`
	TemplateID     int    `json:"template_id,omitempty"`
}

DNSZone a DNS zone.

Jump to

Keyboard shortcuts

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