dnsregister

package
v1.1.16 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

The `dnsregister` task implements a server which can register DNS entries

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWithPlugin

func NewWithPlugin(p Plugin) (*t, error)

Create a new logger task with provider of other tasks

Types

type DNSEvent

type DNSEvent uint
const (
	ExternalIP DNSEvent = iota
	NotModified
	Modified
)

func (DNSEvent) String

func (e DNSEvent) String() string

type Plugin

type Plugin struct {
	task.Plugin
	Timeout_ types.Duration `json:"timeout,omitempty"` // Read timeout on HTTP requests
	Delta_   types.Duration `json:"delta,omitempty"`   // Time between updating information
	Records_ []Record       `json:"records"`           // Records to register
}

func WithLabel

func WithLabel(label string) Plugin

func (Plugin) Delta

func (p Plugin) Delta() time.Duration

func (Plugin) Name

func (p Plugin) Name() string

func (Plugin) New

func (p Plugin) New(ctx context.Context, provider iface.Provider) (iface.Task, error)

Create a new logger task with provider of other tasks

func (Plugin) Records

func (p Plugin) Records() []Record

func (Plugin) Timeout

func (p Plugin) Timeout() time.Duration

type Record

type Record struct {
	Name     string `json:"hostname"`           // Name of record
	Address  string `json:"address,omitempty"`  // Address of record
	User     string `json:"user,omitempty"`     // Username for registration
	Password string `json:"password,omitempty"` // Password for registration
}

func (Record) IP

func (r Record) IP() net.IP

Return the net.IP value for an address, or nil if invalid

func (Record) IsZero

func (r Record) IsZero() bool

Return true if this record is invalid (the name is nil)

func (Record) String

func (r Record) String() string

type Register

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

func New

func New(timeout time.Duration) *Register

Create a new logger task with provider of other tasks

func (*Register) GetExternalAddress

func (r *Register) GetExternalAddress() (net.IP, error)

GetExternalAddress returns the current external IP address as reported by https://api.ipify.org

func (*Register) RegisterAddress

func (r *Register) RegisterAddress(host, user, password string, addr net.IP, offline bool) error

RegisterAddress registers address with Google DNS and returns the response https://support.google.com/domains/answer/6147083?hl=en

func (*Register) String

func (r *Register) String() string

Jump to

Keyboard shortcuts

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