internal

package
v4.15.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBaseURL = "https://api.loopia.se/RPCSERV"

DefaultBaseURL is url to the XML-RPC api.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client the Loopia client.

func NewClient

func NewClient(apiUser, apiPassword string) *Client

NewClient creates a new Loopia Client.

func (*Client) AddTXTRecord

func (c *Client) AddTXTRecord(ctx context.Context, domain string, subdomain string, ttl int, value string) error

AddTXTRecord adds a TXT record.

func (*Client) GetTXTRecords

func (c *Client) GetTXTRecords(ctx context.Context, domain string, subdomain string) ([]RecordObj, error)

GetTXTRecords gets TXT records.

func (*Client) RemoveSubdomain

func (c *Client) RemoveSubdomain(ctx context.Context, domain, subdomain string) error

RemoveSubdomain remove a sub-domain.

func (*Client) RemoveTXTRecord

func (c *Client) RemoveTXTRecord(ctx context.Context, domain string, subdomain string, recordID int) error

RemoveTXTRecord removes a TXT record.

type RPCError

type RPCError struct {
	FaultCode   int
	FaultString string
}

func (RPCError) Error

func (e RPCError) Error() string

type RecordObj

type RecordObj struct {
	Type     string
	TTL      int
	Priority int
	Rdata    string
	RecordID int
}

func (*RecordObj) UnmarshalXML

func (r *RecordObj) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

Jump to

Keyboard shortcuts

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