azure

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

This section is empty.

Variables

This section is empty.

Functions

func AddFlags

func AddFlags(flags *pflag.FlagSet)

AddFlags adds flags for Builder.

func ToFqdn

func ToFqdn(name string) string

ToFqdn converts the name into a fqdn appending a trailing dot.

func UnFqdn

func UnFqdn(name string) string

UnFqdn converts the fqdn into a name removing the trailing dot.

Types

type AzUpdater

type AzUpdater struct {
	Builder
	// contains filtered or unexported fields
}

AzUpdater holds the information necessary to successfully run update requests

func (*AzUpdater) AddRR

func (azu *AzUpdater) AddRR(record hookTypes.DNSRecord, ttl time.Duration) (err error)

AddRR adds a Resource Record

func (*AzUpdater) RemoveRR

func (azu *AzUpdater) RemoveRR(name, recordType string) (err error)

RemoveRR removes a Resource Record

func (*AzUpdater) UpdateRR

func (azu *AzUpdater) UpdateRR(record hookTypes.DNSRecord, ttl time.Duration) (err error)

UpdateRR updates a DNS Resource Record

type Builder

type Builder struct {
	Zone string

	ClientID     string
	ClientSecret string
	TenantID     string

	SubscriptionID string
	ResourceGroup  string

	HTTPClient *http.Client
}

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() (*AzUpdater, error)

New constructs a new AzUpdater 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 update commands

Jump to

Keyboard shortcuts

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