porkbun

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2021 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 {
	// contains filtered or unexported fields
}

Client is a struct containing Porkbun API Key and Secret.

func NewClient

func NewClient(apiKey, secretAPIKey string) *Client

NewClient creates a new instance of Client.

func (*Client) CreateOrEditRecord

func (c *Client) CreateOrEditRecord(ctx context.Context, zone string, record HostRecord) (HostRecord, error)

CreateOrEditRecord creates or edits a DNS Host Record using the Porkbun API.

func (*Client) DeleteRecord

func (c *Client) DeleteRecord(ctx context.Context, zone string, record libdns.Record) error

DeleteRecord deletes a DNS Host Record using the Porkbun API

func (*Client) GetHostRecords

func (c *Client) GetHostRecords(ctx context.Context, zone string) ([]HostRecord, error)

GetHostRecords retrieves all existing DNS Host Records using the Porkbun API.

type HostRecord

type HostRecord struct {
	ID         string     `json:"id,omitempty"`
	Name       string     `json:"name"`
	RecordType RecordType `json:"type"`
	Content    string     `json:"content"`
	TTL        uint16     `json:"ttl,string"`
	Priority   string     `json:"priority"`
	Notes      string     `json:"notes"`
}

HostRecord is a struct that contains all the details of a DNS record required by the Porkbun API.

type RecordType

type RecordType string

RecordType is the type of DNS Record.

const (
	// A Record
	A RecordType = "A"
	// AAAA Record
	AAAA RecordType = "AAAA"
	// ALIAS Record
	ALIAS RecordType = "ALIAS"
	// CAA Record
	CAA RecordType = "CAA"
	// CNAME Record
	CNAME RecordType = "CNAME"
	// MX Record
	MX RecordType = "MX"
	// MXE Record
	MXE RecordType = "MXE"
	// NS Record
	NS RecordType = "NS"
	// TXT Record
	TXT RecordType = "TXT"
	// URL Record
	URL RecordType = "URL"
	// URL301 Record
	URL301 RecordType = "URL301"
	// FRAME Record
	FRAME RecordType = "FRAME"
)

Jump to

Keyboard shortcuts

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