internal

package
v4.12.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultEndpoint = "https://api.zone.eu/v2/"

DefaultEndpoint the default API endpoint.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client the API client for Zoneee.

func NewClient

func NewClient(username string, apiKey string) *Client

NewClient creates a new Client.

func (*Client) AddTxtRecord

func (c *Client) AddTxtRecord(ctx context.Context, domain string, record TXTRecord) ([]TXTRecord, error)

AddTxtRecord creates a TXT records. https://api.zone.eu/v2#operation/creatednstxtrecord

func (*Client) GetTxtRecords

func (c *Client) GetTxtRecords(ctx context.Context, domain string) ([]TXTRecord, error)

GetTxtRecords get TXT records. https://api.zone.eu/v2#operation/getdnstxtrecords

func (*Client) RemoveTxtRecord

func (c *Client) RemoveTxtRecord(ctx context.Context, domain, id string) error

RemoveTxtRecord deletes a TXT record. https://api.zone.eu/v2#operation/deletednstxtrecord

type TXTRecord

type TXTRecord struct {
	// Identifier (identificator)
	ID string `json:"id,omitempty"`
	// Hostname
	Name string `json:"name"`
	// TXT content value
	Destination string `json:"destination"`
	// Can this record be deleted
	Delete bool `json:"delete,omitempty"`
	// Can this record be modified
	Modify bool `json:"modify,omitempty"`
	// API url to get this entity
	ResourceURL string `json:"resource_url,omitempty"`
}

Jump to

Keyboard shortcuts

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