models

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2017 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultTTL = uint32(300)

Variables

This section is empty.

Functions

func InterfaceToIP

func InterfaceToIP(i interface{}) (net.IP, error)

Types

type Correction

type Correction struct {
	F   func() error `json:"-"`
	Msg string
}

Correction is anything that can be run. Implementation is up to the specific provider.

type DNSConfig

type DNSConfig struct {
	Registrars   []*RegistrarConfig   `json:"registrars"`
	DNSProviders []*DNSProviderConfig `json:"dns_providers"`
	Domains      []*DomainConfig      `json:"domains"`
}

func (*DNSConfig) FindDomain

func (config *DNSConfig) FindDomain(query string) *DomainConfig

type DNSProviderConfig

type DNSProviderConfig struct {
	Name     string          `json:"name"`
	Type     string          `json:"type"`
	Metadata json.RawMessage `json:"meta,omitempty"`
}

type DomainConfig

type DomainConfig struct {
	Name         string            `json:"name"` // NO trailing "."
	Registrar    string            `json:"registrar"`
	DNSProviders map[string]int    `json:"dnsProviders"`
	Metadata     map[string]string `json:"meta,omitempty"`
	Records      []*RecordConfig   `json:"records"`
	Nameservers  []*Nameserver     `json:"nameservers,omitempty"`
	KeepUnknown  bool              `json:"keepunknown"`
}

func (*DomainConfig) Copy

func (dc *DomainConfig) Copy() (*DomainConfig, error)

func (*DomainConfig) HasRecordTypeName

func (dc *DomainConfig) HasRecordTypeName(rtype, name string) bool

type Nameserver

type Nameserver struct {
	Name   string `json:"name"` // Normalized to a FQDN with NO trailing "."
	Target string `json:"target"`
}

func StringsToNameservers

func StringsToNameservers(nss []string) []*Nameserver

type RecordConfig

type RecordConfig struct {
	Type     string            `json:"type"`
	Name     string            `json:"name"`   // The short name. See below.
	Target   string            `json:"target"` // If a name, must end with "."
	TTL      uint32            `json:"ttl,omitempty"`
	Metadata map[string]string `json:"meta,omitempty"`
	NameFQDN string            `json:"-"` // Must end with ".$origin". See below.
	Priority uint16            `json:"priority,omitempty"`

	Original interface{} `json:"-"` // Store pointer to provider-specific record object. Used in diffing.
}

RecordConfig stores a DNS record. Providers are responsible for validating or normalizing the data that goes into a RecordConfig. If you update Name, you have to update NameFQDN and vice-versa.

Name:

This is the shortname i.e. the NameFQDN without the origin suffix.
It should never have a trailing "."
It should never be null. It should store It "@", not the apex domain, not null, etc.
It shouldn't end with the domain origin. If the origin is "foo.com." then
   if Name == "foo.com" then that literally means "foo.com.foo.com." is
   the intended FQDN.

NameFQDN:

This is the FQDN version of Name.
It should never have a trailiing ".".

func (*RecordConfig) Copy

func (r *RecordConfig) Copy() (*RecordConfig, error)

func (*RecordConfig) RR

func (r *RecordConfig) RR() dns.RR

/ Convert RecordConfig -> dns.RR.

func (*RecordConfig) String

func (r *RecordConfig) String() string

type RegistrarConfig

type RegistrarConfig struct {
	Name     string          `json:"name"`
	Type     string          `json:"type"`
	Metadata json.RawMessage `json:"meta,omitempty"`
}

Jump to

Keyboard shortcuts

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