proxy

package
v0.0.0-...-bf8b38f Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrZoneNotFound will be returned if the zone cannot be found at Digital Ocean.
	ErrZoneNotFound = errors.New("Zone not found")
)

Functions

This section is empty.

Types

type Domain

type Domain struct {
	*godo.Domain
	ZoneName ZoneName
	Records  []*Record
}

Domain represents a DNS domain from Digital Ocean.

func NewDomain

func NewDomain(zoneName ZoneName) *Domain

NewDomain will instantiate a new Domain from the specified zoneName.

func (*Domain) Add

func (d *Domain) Add(client *godo.Client) error

Add will add a new zone/domain to Digital Ocean.

func (*Domain) Find

func (d *Domain) Find(client *godo.Client) error

Find will try to find the matching domain at Digital Ocean.

func (*Domain) FindOrAdd

func (d *Domain) FindOrAdd(client *godo.Client) error

FindOrAdd will search for the named zone at Digital Ocean - and add it if not found.

func (*Domain) RefreshRecords

func (d *Domain) RefreshRecords(client *godo.Client) error

RefreshRecords retrieves all records from Digital Ocean.

type Record

type Record struct {
	godo.DomainRecord

	Matched bool
	// contains filtered or unexported fields
}

Record represents a domain record from Digital Ocean with extra properties to keep track of sync state.

func NewRecord

func NewRecord(record godo.DomainRecord, zoneName ZoneName) *Record

NewRecord will instantiate a new Record from a DomainRecord and a zoneName.

func (*Record) Delete

func (r *Record) Delete(client *godo.Client) error

Delete will delete the record at Digital Ocean

func (*Record) Matches

func (r *Record) Matches(token *dns.Token) bool

Matches will check if the record from DO matches a token from the zone file.

type ZoneName

type ZoneName string

ZoneName is a zone name without the traling dot.

func NewZoneName

func NewZoneName(zoneName string) ZoneName

NewZoneName will return a new ZoneName. If zoneName contains a trailing dot, it will be removed.

func (ZoneName) FQDN

func (z ZoneName) FQDN(hostname string) string

FQDN will return a fully qualified domain name (in a DNS sense) with a trailing dot. If hostname is @, it will be specialcased to simply return the zonename.

func (ZoneName) String

func (z ZoneName) String(hostname string) string

String behaves like FQDN but doesn't add the trailing dot.

Jump to

Keyboard shortcuts

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