nsupdate

package
v0.0.0-...-a9765df Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFlags

func AddFlags(flags *pflag.FlagSet)

AddFlags adds flags for Builder.

Types

type Builder

type Builder struct {
	Server   string
	Port     string
	KeyFile  string
	BasePath string
	Zone     string
	Debug    bool
}

func (*Builder) InitFromViper

func (b *Builder) InitFromViper(v *viper.Viper) *Builder

InitFromViper initializes Builder with properties retrieved from Viper.

func (*Builder) New

func (b *Builder) New(basePath string) (*NSUpdate, error)

New constructs a new NSUpdate instance from environment variables

type DNSUpdater

type DNSUpdater interface {
	RemoveRR(name, recordType string) (err error)
	AddRR(record hookTypes.DNSRecord, ttl time.Duration) (err error)
	UpdateRR(record hookTypes.DNSRecord, ttl time.Duration) (err error)
}

DNSUpdater defines an interface to communicate with DNS Server via nsupdate commands

type NSUpdate

type NSUpdate struct {
	Builder
}

NSUpdate holds the information necessary to successfully run nsupdate requests

func (*NSUpdate) AddRR

func (nsu *NSUpdate) AddRR(record hookTypes.DNSRecord, ttl time.Duration) (err error)

AddRR adds a Resource Record

func (*NSUpdate) BuildCmdFile

func (nsu *NSUpdate) BuildCmdFile(cmd string) (fileName string, err error)

BuildCmdFile creates an nsupdate cmd file

func (*NSUpdate) ExecCmdFile

func (nsu *NSUpdate) ExecCmdFile(filePath string) (err error)

ExecCmdFile executes an nsupdate cmd file

func (*NSUpdate) ExecuteCommand

func (nsu *NSUpdate) ExecuteCommand(cmd string) (err error)

ExecuteCommand executes a given nsupdate command

func (*NSUpdate) RemoveRR

func (nsu *NSUpdate) RemoveRR(name, recordType string) (err error)

RemoveRR removes a Resource Record

func (*NSUpdate) UpdateRR

func (nsu *NSUpdate) UpdateRR(record hookTypes.DNSRecord, ttl time.Duration) (err error)

UpdateRR updates a DNS Resource Record

Jump to

Keyboard shortcuts

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