loopia

package
v4.14.3 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: MIT Imports: 19 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultBaseNOURL = "https://api.loopia.no/RPCSERV"
	DefaultBaseRSURL = "https://api.loopia.rs/RPCSERV"
	DefaultBaseSEURL = "https://api.loopia.se/RPCSERV"
)

DefaultBaseNOURL and others are RPC end-points.

Variables

This section is empty.

Functions

func AuditRecords

func AuditRecords(records []*models.RecordConfig) []error

AuditRecords returns a list of errors corresponding to the records that aren't supported by this provider. If all records are supported, an empty list is returned.

func PrepDesiredRecords

func PrepDesiredRecords(dc *models.DomainConfig)

PrepDesiredRecords munges any records to best suit this provider.

Types

type APIClient

type APIClient struct {
	APIUser           string
	APIPassword       string
	BaseURL           string
	HTTPClient        *http.Client
	ModifyNameServers bool
	FetchNSEntries    bool
	Debug             bool
	// contains filtered or unexported fields
}

APIClient is the APIClient handle used to store any client-related state.

func NewClient

func NewClient(apiUser, apiPassword string, region string, modifyns bool, fetchns bool, debug bool) *APIClient

NewClient creates a new LoopiaClient.

func (*APIClient) CreateRecord

func (c *APIClient) CreateRecord(domain string, subdomain string, record paramStruct) error

CreateRecord adds a record.

func (*APIClient) CreateRecordSimulate

func (c *APIClient) CreateRecordSimulate(domain string, subdomain string, record paramStruct) error

CreateRecordSimulate only prints info about a record addition. Used for debugging.

func (*APIClient) DeleteRecord

func (c *APIClient) DeleteRecord(domain string, subdomain string, recordID uint32) error

DeleteRecord deletes a record.

func (*APIClient) DeleteRecordSimulate

func (c *APIClient) DeleteRecordSimulate(domain string, subdomain string, recordID uint32) error

DeleteRecordSimulate only prints info about a record deletion. Used for debugging.

func (*APIClient) DeleteSubdomain

func (c *APIClient) DeleteSubdomain(domain, subdomain string) error

DeleteSubdomain deletes a sub-domain and its child records.

func (*APIClient) GetDomainNS

func (c *APIClient) GetDomainNS(domain string) ([]string, error)

GetDomainNS gets all NS records for a subdomain, in this case, the apex "@"

func (*APIClient) GetNameservers

func (c *APIClient) GetNameservers(domain string) ([]*models.Nameserver, error)

GetNameservers returns a list of nameservers for domain.

func (*APIClient) GetRegistrarCorrections

func (c *APIClient) GetRegistrarCorrections(dc *models.DomainConfig) ([]*models.Correction, error)

GetRegistrarCorrections returns a list of corrections for this registrar.

func (*APIClient) GetSubDomains

func (c *APIClient) GetSubDomains(domain string) ([]string, error)

GetSubDomains gets all the subdomains within a domain, no records

func (*APIClient) GetZoneRecords

func (c *APIClient) GetZoneRecords(domain string, meta map[string]string) (models.Records, error)

GetZoneRecords gathers the DNS records and converts them to dnscontrol's format.

func (*APIClient) GetZoneRecordsCorrections

func (c *APIClient) GetZoneRecordsCorrections(dc *models.DomainConfig, existingRecords models.Records) ([]*models.Correction, int, error)

GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.

func (*APIClient) ListZones

func (c *APIClient) ListZones() ([]string, error)

ListZones lists the zones on this account.

func (*APIClient) UpdateRecord

func (c *APIClient) UpdateRecord(domain string, subdomain string, rec paramStruct) error

UpdateRecord updates a record.

func (*APIClient) UpdateRecordSimulate

func (c *APIClient) UpdateRecordSimulate(domain string, subdomain string, rec paramStruct) error

UpdateRecordSimulate only prints info about a record update. Used for debugging.

type Property

type Property struct {
	Key   string `xml:"name"`
	Value Value  `xml:"value"`
}

Property is an XML Key/value.

func (Property) Bool

func (p Property) Bool() bool

Bool is an accessor to the Property's value when it is a boolean.

func (Property) Int

func (p Property) Int() int

Int is an accessor to the Property's value when it is a integer.

func (Property) Name

func (p Property) Name() string

Name is an accessor to the Property's name.

func (Property) String

func (p Property) String() string

String is an accessor to the Property's value when it is a string.

type Value

type Value struct {
	// String string `xml:",any"`
	String string `xml:"string"`
	Int    int    `xml:"int"`
	Bool   bool   `xml:"bool"`
}

Value is a xml any

Jump to

Keyboard shortcuts

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