internal

package
v4.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2020 License: MIT Imports: 6 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 Lua DNS API client.

func NewClient

func NewClient(apiUsername, apiToken string) *Client

NewClient creates a new Client.

func (*Client) CreateRecord

func (d *Client) CreateRecord(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 (d *Client) DeleteRecord(record *DNSRecord) error

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

func (*Client) ListZones

func (d *Client) ListZones() ([]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