1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

docs: Improve comments related to capabilities.

This commit is contained in:
Tom Limoncelli
2017-12-21 09:19:39 -05:00
parent 8baf9ee1a4
commit 9e90f59f33
3 changed files with 40 additions and 16 deletions

View File

@ -61,6 +61,7 @@ type DNSProviderConfig struct {
// This is the FQDN version of Name. // This is the FQDN version of Name.
// It should never have a trailiing ".". // It should never have a trailiing ".".
// Valid types: // Valid types:
// Official:
// A // A
// AAAA // AAAA
// ANAME // ANAME
@ -68,10 +69,22 @@ type DNSProviderConfig struct {
// CNAME // CNAME
// MX // MX
// NS // NS
// PTR
// SRV // SRV
// TLSA
// TXT // TXT
// PAGE_RULE // pseudo rtype // Pseudo-Types:
// TODO(tal): Add all the pseudo types // ALIAs
// CF_REDIRECT
// CF_TEMP_REDIRECT
// FRAME
// IMPORT_TRANSFORM
// NAMESERVER
// NO_PURGE
// PAGE_RULE
// PURGE
// URL
// URL301
type RecordConfig struct { type RecordConfig struct {
Type string `json:"type"` Type string `json:"type"`
Name string `json:"name"` // The short name. See below. Name string `json:"name"` // The short name. See below.
@ -79,7 +92,7 @@ type RecordConfig struct {
TTL uint32 `json:"ttl,omitempty"` TTL uint32 `json:"ttl,omitempty"`
Metadata map[string]string `json:"meta,omitempty"` Metadata map[string]string `json:"meta,omitempty"`
NameFQDN string `json:"-"` // Must end with ".$origin". See below. NameFQDN string `json:"-"` // Must end with ".$origin". See below.
MxPreference uint16 `json:"mxpreference,omitempty"` // FIXME(tlim): Rename to MxPreference MxPreference uint16 `json:"mxpreference,omitempty"`
SrvPriority uint16 `json:"srvpriority,omitempty"` SrvPriority uint16 `json:"srvpriority,omitempty"`
SrvWeight uint16 `json:"srvweight,omitempty"` SrvWeight uint16 `json:"srvweight,omitempty"`
SrvPort uint16 `json:"srvport,omitempty"` SrvPort uint16 `json:"srvport,omitempty"`

View File

@ -56,8 +56,13 @@ func initBind(config map[string]string, providermeta json.RawMessage) (providers
} }
func init() { func init() {
providers.RegisterDomainServiceProviderType("BIND", initBind, providers.CanUsePTR, providers.RegisterDomainServiceProviderType("BIND", initBind,
providers.CanUseSRV, providers.CanUseCAA, providers.CanUseTLSA, providers.CantUseNOPURGE, docNotes) providers.CanUsePTR,
providers.CanUseSRV,
providers.CanUseCAA,
providers.CanUseTLSA,
providers.CantUseNOPURGE,
docNotes)
} }
type SoaInfo struct { type SoaInfo struct {

View File

@ -8,17 +8,23 @@ import (
type Capability uint32 type Capability uint32
const ( const (
// CanUseAlias indicates the provider support ALIAS records (or flattened CNAMES). Up to the provider to translate them to the appropriate record type.
// If you add something to this list, you probably want to add it to pkg/normalize/validate.go checkProviderCapabilities() or somewhere near there. // If you add something to this list, you probably want to add it to pkg/normalize/validate.go checkProviderCapabilities() or somewhere near there.
// CanUseAlias indicates the provider support ALIAS records (or flattened CNAMES). Up to the provider to translate them to the appropriate record type.
CanUseAlias Capability = iota CanUseAlias Capability = iota
// CanUsePTR indicates the provider can handle PTR records // CanUsePTR indicates the provider can handle PTR records
CanUsePTR CanUsePTR
// CanUseSRV indicates the provider can handle SRV records // CanUseSRV indicates the provider can handle SRV records
CanUseSRV CanUseSRV
// CanUseCAA indicates the provider can handle CAA records // CanUseCAA indicates the provider can handle CAA records
CanUseCAA CanUseCAA
// CanUseTLSA indicates the provider can handle TLSA records // CanUseTLSA indicates the provider can handle TLSA records
CanUseTLSA CanUseTLSA
// CantUseNOPURGE indicates NO_PURGE is broken for this provider. To make it // CantUseNOPURGE indicates NO_PURGE is broken for this provider. To make it
// work would require complex emulation of an incremental update mechanism, // work would require complex emulation of an incremental update mechanism,
// so it is easier to simply mark this feature as not working for this // so it is easier to simply mark this feature as not working for this