backends

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IPv4 means that the DNS records is a IPv4 address
	IPv4 = "A"

	// IPv6 means that the DNS records is a IPv4 address
	IPv6 = "AAAA"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressType

type AddressType string

AddressType is the address type of a DNS record: `IPv4` or `IPv6`.

type Backend

type Backend interface {
	Configure(cfg *viper.Viper, domain string, ttl int) error

	Update(name string, ip string, addressType AddressType) error
}

Backend is the interface for GoDDNS backend and allows a simple extension of GoDDNS.

func GetBackend

func GetBackend(name string, cfg *viper.Viper, domain string, ttl int) Backend

GetBackend returns the specified backend ready for use or exits with a fatal error.

type DummyBackend

type DummyBackend struct {
	// contains filtered or unexported fields
}

DummyBackend is a GoDDNS backend for debugging, it just prints the DNS record changes.

func (*DummyBackend) Configure

func (backend *DummyBackend) Configure(cfg *viper.Viper, domain string, ttl int) error

Configure does not have much to do for the Dummy backend

func (*DummyBackend) Update

func (backend *DummyBackend) Update(name string, ip string, addressType AddressType) error

Update writes a new record to the terminal

type PowerDNSBackend

type PowerDNSBackend struct {
	// contains filtered or unexported fields
}

PowerDNSBackend is a GoDDNS backend for PowerDNS with PostgresSQL

func (*PowerDNSBackend) Configure

func (backend *PowerDNSBackend) Configure(cfg *viper.Viper, domain string, ttl int) error

Configure reads the database config for the PowerDNS + PostgresSQL backend

func (*PowerDNSBackend) Update

func (backend *PowerDNSBackend) Update(name string, ip string, addressType AddressType) error

Update writes a new record to the PostgresSQL database of PowerDNS

Jump to

Keyboard shortcuts

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