rimuhosting

package
v4.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultZonomiBaseURL      = "https://zonomi.com/app/dns/dyndns.jsp"
	DefaultRimuHostingBaseURL = "https://rimuhosting.com/dns/dyndns.jsp"
)

Base URL for the RimuHosting DNS services.

View Source
const (
	SetAction    = "SET"
	QueryAction  = "QUERY"
	DeleteAction = "DELETE"
)

Action names.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	XMLName xml.Name `xml:"error"`
	Text    string   `xml:",chardata"`
}

func (APIError) Error

func (a APIError) Error() string

type Action

type Action struct {
	Action  string   `xml:"action,attr"`
	Host    string   `xml:"host,attr"`
	Type    string   `xml:"type,attr"`
	Records []Record `xml:"record"`
}

type ActionParameter

type ActionParameter struct {
	Action   string `url:"action,omitempty"`
	Name     string `url:"name,omitempty"`
	Type     string `url:"type,omitempty"`
	Value    string `url:"value,omitempty"`
	TTL      int    `url:"ttl,omitempty"`
	Priority int    `url:"prio,omitempty"`
}

func NewAddRecordAction

func NewAddRecordAction(domain, content string, ttl int) ActionParameter

NewAddRecordAction helper to create an action to add a TXT record.

func NewDeleteRecordAction

func NewDeleteRecordAction(domain, content string) ActionParameter

NewDeleteRecordAction helper to create an action to delete a TXT record.

type Actions

type Actions struct {
	Action Action `xml:"action"`
}

type Client

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

Client the RimuHosting/Zonomi client.

func NewClient

func NewClient(apiKey string) *Client

NewClient Creates a RimuHosting/Zonomi client.

func (Client) DoActions

func (c Client) DoActions(ctx context.Context, actions ...ActionParameter) (*DNSAPIResult, error)

DoActions performs actions.

type DNSAPIResult

type DNSAPIResult struct {
	XMLName      xml.Name     `xml:"dnsapi_result"`
	IsOk         string       `xml:"is_ok"`
	ResultCounts ResultCounts `xml:"result_counts"`
	Actions      Actions      `xml:"actions"`
}

type Record

type Record struct {
	Name     string `xml:"name,attr"`
	Type     string `xml:"type,attr"`
	Content  string `xml:"content,attr"`
	TTL      string `xml:"ttl,attr"`
	Priority string `xml:"prio,attr"`
}

type ResultCounts

type ResultCounts struct {
	Added     string `xml:"added,attr"`
	Changed   string `xml:"changed,attr"`
	Unchanged string `xml:"unchanged,attr"`
	Deleted   string `xml:"deleted,attr"`
}

Jump to

Keyboard shortcuts

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