dns

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAuthNoDomain = errors.New("the supplied domain failed authentication")

ErrAuthNoDomain indicates that a request failed authentication because the domain was not found. If encountered, a new domain needs to be reserved.

Functions

This section is empty.

Types

type AuthErrorResponse

type AuthErrorResponse struct {
	Status  int           `json:"status,omitempty"`
	Message string        `json:"msg,omitempty"`
	Data    authErrorData `json:"data,omitempty"`
}

type Client

type Client interface {
	// ReserveDomain calls Uncloud DNS to reserve a new domain. It returns the domain, a token for authentication,
	// and an error.
	ReserveDomain(endpoint string) (string, string, error)

	// CreateRecords calls Uncloud DNS to create or update DNS records based on the supplied RecordRequests
	// for the specified domain.
	CreateRecords(endpoint, domain, token string, records []RecordRequest) ([]RecordResponse, error)
}

Client handles interactions with the Uncloud DNS API service.

func NewClient

func NewClient() Client

NewClient creates a new AcornDNS client

type DomainResponse

type DomainResponse struct {
	Name  string `json:"name,omitempty"`
	Token string `json:"token,omitempty"`
}

type RecordRequest

type RecordRequest struct {
	Name   string     `json:"name,omitempty"`
	Type   RecordType `json:"type,omitempty"`
	Values []string   `json:"values,omitempty"`
}

type RecordResponse

type RecordResponse struct {
	RecordRequest
	FQDN string `json:"fqdn,omitempty"`
}

type RecordType

type RecordType string
const (
	RecordTypeA    RecordType = "A"
	RecordTypeAAAA RecordType = "AAAA"
)

Jump to

Keyboard shortcuts

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