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

View Source
const DefaultBaseURL = "https://www.versio.nl/api/v1/"

DefaultBaseURL 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 Versio DNS.

func NewClient

func NewClient(username string, password string) *Client

NewClient creates a new Client.

func (*Client) GetDomain

func (c *Client) GetDomain(ctx context.Context, domain string) (*DomainInfoResponse, error)

GetDomain gets domain information. https://www.versio.nl/RESTapidoc/#api-Domains-Domain

func (*Client) UpdateDomain

func (c *Client) UpdateDomain(ctx context.Context, domain string, msg *DomainInfo) (*DomainInfoResponse, error)

UpdateDomain updates domain information. https://www.versio.nl/RESTapidoc/#api-Domains-Update

type DomainInfo

type DomainInfo struct {
	DNSRecords []Record `json:"dns_records"`
}

type DomainInfoResponse

type DomainInfoResponse struct {
	DomainInfo DomainInfo `json:"domainInfo"`
}

type ErrorMessage

type ErrorMessage struct {
	Code    int    `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
}

func (ErrorMessage) Error

func (e ErrorMessage) Error() string

type ErrorResponse

type ErrorResponse struct {
	Message ErrorMessage `json:"error"`
}

type Record

type Record struct {
	Type     string `json:"type,omitempty"`
	Name     string `json:"name,omitempty"`
	Value    string `json:"value,omitempty"`
	Priority int    `json:"prio,omitempty"`
	TTL      int    `json:"ttl,omitempty"`
}

Jump to

Keyboard shortcuts

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