loopia

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

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

Go to latest
Published: May 25, 2021 License: MIT Imports: 10 Imported by: 1

README

libdns-loopia for libdns

Go Reference Go

Loopia API

This package implements the libdns interfaces for Loopia, allowing you to manage DNS records.

Usage

include (
    loopia "github.com/kmpm/libdns-loopia"
)
p := &loopia.Provider{
    Username: "youruser@loopiaapi",
    Password: "yourpassword",
}

zone := "example.org"
records, err := p.GetRecords(ctx, zone)

For more details check the _examples folder in the source.

Noteworthy

If you are adding or chainging records, like acme/letsencrypt validation, Loopia is somewhat slow to propagate the result. It might take up to 15 minutes. That said, I have seen it come throug in as little as 1,5 minutes.

To do everything this library can do the Loopia API user needs access to the following...

  • getSubdomains
  • addSubdomain
  • removeSubdomain
  • getZoneRecords
  • addZoneRecord
  • updateZoneRecord
  • removeZoneRecord

Documentation

Overview

Package libdns-loopia implements a DNS record management client compatible with the libdns interfaces for Loopia.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Log

func Log() *zap.SugaredLogger

Types

type Provider

type Provider struct {

	// TODO: put config fields here (with snake_case json
	// struct tags on exported fields), for example:
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
	Customer string `json:"customer,omitempty"`
	// contains filtered or unexported fields
}

Provider facilitates DNS record manipulation with Loopia.

func (*Provider) AppendRecords

func (p *Provider) AppendRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)

AppendRecords adds records to the zone. It returns the records that were added.

func (*Provider) DeleteRecords

func (p *Provider) DeleteRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)

DeleteRecords deletes the records from the zone. It returns the records that were deleted.

func (*Provider) GetRecords

func (p *Provider) GetRecords(ctx context.Context, zone string) ([]libdns.Record, error)

GetRecords lists all the records in the zone.

func (*Provider) SetRecords

func (p *Provider) SetRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)

SetRecords sets the records in the zone, either by updating existing records or creating new ones. It returns the updated records.

Directories

Path Synopsis
_examples
acme-like command
list-records command
up-and-down command

Jump to

Keyboard shortcuts

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