loopia

package module
v0.0.0-...-b07b4c9 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: MIT Imports: 2 Imported by: 1

README

loopia

Loopia API Golang

Documentation

Index

Constants

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

APIURL - where API is hosted

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Username    string
	Password    string
	RPCEndpoint string
}

API Struct to store runtime info

func New

func New(username string, password string) (*API, error)

New returns a loopia.API instance

func (*API) AddSubdomain

func (api *API) AddSubdomain(domain string, subdomain string) (*Status, error)

AddSubdomain - method for creating subdomain

func (*API) AddZoneRecord

func (api *API) AddZoneRecord(domain string, subdomain string, record *Record) error

AddZoneRecord - Create zone record

func (*API) Call

func (api *API) Call(serviceMethod string, args []interface{}, reply interface{}) error

func (*API) GetSubdomain

func (api *API) GetSubdomain(domain string, subdomain string) (*Subdomain, error)

GetSubdomain ...

func (*API) GetSubdomains

func (api *API) GetSubdomains(domain string) ([]Subdomain, error)

GetSubdomains - Method for fetching all subdomains

func (*API) GetZoneRecord

func (api *API) GetZoneRecord(domain string, subdomain string, id int64) (*Record, error)

GetZoneRecord - fetch specific zone record

func (*API) GetZoneRecords

func (api *API) GetZoneRecords(domain string, subdomain string) ([]Record, error)

GetZoneRecords - fetch subdomains records

func (*API) RemoveSubDomain

func (api *API) RemoveSubDomain(domain string, subdomain string) (*Status, error)

RemoveSubDomain - Removes a subdomain

func (*API) RemoveZoneRecord

func (api *API) RemoveZoneRecord(domain string, subdomain string, id int64) (*Status, error)

RemoveZoneRecord - remove zone record

func (*API) UpdateZoneRecord

func (api *API) UpdateZoneRecord(domain string, subdomain string, record Record) (*Status, error)

UpdateZoneRecord -

func (*API) XMLRPCClient

func (api *API) XMLRPCClient() *xmlrpc.Client

XMLRPCClient to interact with Loopia XMLRPC

type Record

type Record struct {
	ID       int64  `xmlrpc:"record_id"`
	TTL      int    `xmlrpc:"ttl"`
	Type     string `xmlrpc:"type"`
	Value    string `xmlrpc:"rdata"`
	Priority int    `xmlrpc:"priority"`
}

Record descired Loopia record_obj

type Status

type Status struct {
	Status string
	Cause  string
}

Status - operation status wrapper

type Subdomain

type Subdomain struct {
	Name string
}

Subdomain ...

Jump to

Keyboard shortcuts

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