Documentation
¶
Index ¶
- Constants
- func InterfaceToIP(i interface{}) (net.IP, error)
- func SplitCombinedMxValue(s string) (preference uint16, target string, err error)
- func SplitCombinedSrvValue(s string) (priority, weight, port uint16, target string, err error)
- type Correction
- type DNSConfig
- type DNSProviderConfig
- type DomainConfig
- type Nameserver
- type RecordConfig
- type RecordKey
- type Records
- type RegistrarConfig
Constants ¶
const DefaultTTL = uint32(300)
Variables ¶
This section is empty.
Functions ¶
func InterfaceToIP ¶
func SplitCombinedMxValue ¶ added in v0.1.5
SplitCombinedMxValue splits a combined MX preference and target into separate entities, i.e. splitting "10 aspmx2.googlemail.com." into "10" and "aspmx2.googlemail.com.".
func SplitCombinedSrvValue ¶ added in v0.2.2
SplitCombinedSrvValue splits a combined SRV priority, weight, port and target into separate entities, some DNS providers want "5" "10" 15" and "foo.com.", while other providers want "5 10 15 foo.com.".
Types ¶
type Correction ¶
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 Records `json:"records"`
Nameservers []*Nameserver `json:"nameservers,omitempty"`
KeepUnknown bool `json:"keepunknown,omitempty"`
}
func (*DomainConfig) CombineMXs ¶ added in v0.1.5
func (dc *DomainConfig) CombineMXs()
CombineMXs will merge the priority into the target field for all mx records. Useful for providers that desire them as one field.
func (*DomainConfig) CombineSRVs ¶ added in v0.2.2
func (dc *DomainConfig) CombineSRVs()
CombineSRVs will merge the priority, weight, and port into the target field for all srv records. Useful for providers that desire them as one field.
func (*DomainConfig) Copy ¶
func (dc *DomainConfig) Copy() (*DomainConfig, error)
func (*DomainConfig) Filter ¶ added in v0.1.5
func (dc *DomainConfig) Filter(f func(r *RecordConfig) bool)
func (*DomainConfig) HasRecordTypeName ¶
func (dc *DomainConfig) HasRecordTypeName(rtype, name string) bool
func (*DomainConfig) Punycode ¶ added in v0.1.5
func (dc *DomainConfig) Punycode() error
Punycode will convert all records to punycode format. It will encode: - Name - NameFQDN - Target (CNAME and MX only)
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.
MxPreference uint16 `json:"mxpreference,omitempty"` // FIXME(tlim): Rename to MxPreference
SrvPriority uint16 `json:"srvpriority,omitempty"`
SrvWeight uint16 `json:"srvweight,omitempty"`
SrvPort uint16 `json:"srvport,omitempty"`
CaaTag string `json:"caatag,omitempty"`
CaaFlag uint8 `json:"caaflag,omitempty"`
TlsaUsage uint8 `json:"tlsausage,omitempty"`
TlsaSelector uint8 `json:"tlsaselector,omitempty"`
TlsaMatchingType uint8 `json:"tlsamatchingtype,omitempty"`
CombinedTarget bool `json:"-"`
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) Content ¶ added in v0.1.5
func (r *RecordConfig) Content() string
Content combines Target and other fields into one string.
func (*RecordConfig) Copy ¶
func (r *RecordConfig) Copy() (*RecordConfig, error)
func (*RecordConfig) Key ¶ added in v0.2.2
func (r *RecordConfig) Key() RecordKey
func (*RecordConfig) MergeToTarget ¶ added in v0.1.5
func (r *RecordConfig) MergeToTarget()
MergeToTarget combines "extra" fields into .Target, and zeros the merged fields.
func (*RecordConfig) String ¶
func (r *RecordConfig) String() (content string)
func (*RecordConfig) ToRR ¶ added in v0.1.5
func (rc *RecordConfig) ToRR() dns.RR
/ Convert RecordConfig -> dns.RR.
type Records ¶ added in v0.2.2
type Records []*RecordConfig
type RegistrarConfig ¶
type RegistrarConfig struct {
Name string `json:"name"`
Type string `json:"type"`
Metadata json.RawMessage `json:"meta,omitempty"`
}