manager

package
v0.0.0-...-ff20d32 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Extension sets the extension of the files holding the records infos
	Extension = "bindman"
)

Variables

This section is empty.

Functions

func AddFlags

func AddFlags(flags *pflag.FlagSet)

AddFlags adds flags for Options.

Types

type Builder

type Builder struct {
	TTL          time.Duration
	RemovalDelay time.Duration
}

func (*Builder) InitFromViper

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

InitFromViper initializes Options with properties retrieved from Viper.

func (*Builder) New

func (b *Builder) New(dnsupdater azure.DNSUpdater, basePath string) (*Manager, error)

New creates a new Manager instance

type Manager

type Manager struct {
	*Builder
	DNSRecords *diskv.Diskv
	Door       *sync.RWMutex
	DNSUpdater azure.DNSUpdater
}

Manager holds the information for managing a dns server

func (*Manager) AddDNSRecord

func (m *Manager) AddDNSRecord(record hookTypes.DNSRecord) (err error)

AddDNSRecord adds a new DNS record

func (*Manager) GetDNSRecord

func (m *Manager) GetDNSRecord(name, recordType string) (record *hookTypes.DNSRecord, err error)

GetDNSRecord retrieves the dns record identified by name

func (*Manager) GetDNSRecords

func (m *Manager) GetDNSRecords() (records []hookTypes.DNSRecord, err error)

GetDNSRecords retrieves all the dns records being managed

func (*Manager) HasDNSRecord

func (m *Manager) HasDNSRecord(name, recordType string) bool

GetDNSRecord retrieves the dns record identified by name

func (*Manager) RemoveDNSRecord

func (m *Manager) RemoveDNSRecord(name, recordType string) error

RemoveDNSRecord removes a DNS record

func (*Manager) UpdateDNSRecord

func (m *Manager) UpdateDNSRecord(record hookTypes.DNSRecord) (err error)

UpdateDNSRecord updates an existing dns record

Jump to

Keyboard shortcuts

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