internal

package
v0.0.0-...-d25b310 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 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 APIError

type APIError struct {
	Status            int    `json:"status,omitempty"`
	StatusDescription string `json:"status_description,omitempty"`
}

func (APIError) Error

func (e APIError) Error() string

type Client

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

Client a mijn.host DNS API client.

func NewClient

func NewClient(apiKey string) *Client

NewClient creates a new Client.

func (Client) GetRecords

func (c Client) GetRecords(ctx context.Context, domain string) ([]Record, error)

GetRecords Retrieve DNS records of specific domain. https://mijn.host/api/doc/api-3563906

func (Client) ListDomains

func (c Client) ListDomains(ctx context.Context) ([]Domain, error)

ListDomains Retrieve all domains from an account. https://mijn.host/api/doc/api-3563872

func (Client) UpdateRecords

func (c Client) UpdateRecords(ctx context.Context, domain string, records []Record) error

UpdateRecords Update DNS records of specific domain. https://mijn.host/api/doc/api-3563907

type Domain

type Domain struct {
	ID          int      `json:"id"`
	Domain      string   `json:"domain"`
	RenewalDate string   `json:"renewal_date"`
	Status      string   `json:"status"`
	StatusID    int      `json:"status_id"`
	Tags        []string `json:"tags"`
}

type DomainData

type DomainData struct {
	Domains []Domain `json:"domains"`
}

type Record

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

type RecordData

type RecordData struct {
	Domain  string   `json:"domain,omitempty"`
	Records []Record `json:"records,omitempty"`
}

type Response

type Response[T any] struct {
	Status            int    `json:"status,omitempty"`
	StatusDescription string `json:"status_description,omitempty"`
	Data              T      `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

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