ddns

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudFlareProvider

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

CloudFlareProvider encapsulates a CloudFlare DDNS provider.

func (CloudFlareProvider) SetRecord

func (cf CloudFlareProvider) SetRecord(fqdn string, record Record) error

SetRecord sets the `record` for fully qualified domain name `fqdn`

func (CloudFlareProvider) VerifyConfig

func (cf CloudFlareProvider) VerifyConfig() error

VerifyConfig checks the provided credential can access zone information.

type Provider

type Provider interface {
	// Veirfy if the provided environment variables can be used to access DDNS service correctly.
	// For example, check if the login credentials are correct (can successfully update DNS record).
	VerifyConfig() error

	// Set DNS zone record.
	SetRecord(fqdn string, record Record) error
}

Provider interface is responsible for get and set DNS zone records to a DDNS service provider.

func CreateCloudFlareProvider

func CreateCloudFlareProvider() (Provider, error)

CreateCloudFlareProvider creates a DDNS Provider for CloudFlare.

type Record

type Record struct {
	// DNS record type (e.g. A, AAA, TXT)
	Type string

	// DNS record content (e.g. 192.168.0.1)
	Content string
}

Record type stands for a DNS zone record.

Jump to

Keyboard shortcuts

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