mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
CHORE: Linting and comment-fixing (#2937)
This commit is contained in:
@ -80,7 +80,7 @@ func matrixData() *FeatureMatrix {
|
|||||||
DomainModifierAlias = "[`ALIAS`](language-reference/domain-modifiers/ALIAS.md)"
|
DomainModifierAlias = "[`ALIAS`](language-reference/domain-modifiers/ALIAS.md)"
|
||||||
DomainModifierCaa = "[`CAA`](language-reference/domain-modifiers/CAA.md)"
|
DomainModifierCaa = "[`CAA`](language-reference/domain-modifiers/CAA.md)"
|
||||||
DomainModifierDnssec = "[`AUTODNSSEC`](language-reference/domain-modifiers/AUTODNSSEC_ON.md)"
|
DomainModifierDnssec = "[`AUTODNSSEC`](language-reference/domain-modifiers/AUTODNSSEC_ON.md)"
|
||||||
DomainModifierHttps = "[`HTTPS`](language-reference/domain-modifiers/HTTPS.md)"
|
DomainModifierHTTPS = "[`HTTPS`](language-reference/domain-modifiers/HTTPS.md)"
|
||||||
DomainModifierLoc = "[`LOC`](language-reference/domain-modifiers/LOC.md)"
|
DomainModifierLoc = "[`LOC`](language-reference/domain-modifiers/LOC.md)"
|
||||||
DomainModifierNaptr = "[`NAPTR`](language-reference/domain-modifiers/NAPTR.md)"
|
DomainModifierNaptr = "[`NAPTR`](language-reference/domain-modifiers/NAPTR.md)"
|
||||||
DomainModifierPtr = "[`PTR`](language-reference/domain-modifiers/PTR.md)"
|
DomainModifierPtr = "[`PTR`](language-reference/domain-modifiers/PTR.md)"
|
||||||
@ -108,7 +108,7 @@ func matrixData() *FeatureMatrix {
|
|||||||
DomainModifierAlias,
|
DomainModifierAlias,
|
||||||
DomainModifierCaa,
|
DomainModifierCaa,
|
||||||
DomainModifierDnssec,
|
DomainModifierDnssec,
|
||||||
DomainModifierHttps,
|
DomainModifierHTTPS,
|
||||||
DomainModifierLoc,
|
DomainModifierLoc,
|
||||||
DomainModifierNaptr,
|
DomainModifierNaptr,
|
||||||
DomainModifierPtr,
|
DomainModifierPtr,
|
||||||
@ -212,7 +212,7 @@ func matrixData() *FeatureMatrix {
|
|||||||
providers.CanUseDNSKEY,
|
providers.CanUseDNSKEY,
|
||||||
)
|
)
|
||||||
setCapability(
|
setCapability(
|
||||||
DomainModifierHttps,
|
DomainModifierHTTPS,
|
||||||
providers.CanUseHTTPS,
|
providers.CanUseHTTPS,
|
||||||
)
|
)
|
||||||
setCapability(
|
setCapability(
|
||||||
|
@ -2,6 +2,7 @@ package commands
|
|||||||
|
|
||||||
import "github.com/StackExchange/dnscontrol/v4/providers"
|
import "github.com/StackExchange/dnscontrol/v4/providers"
|
||||||
|
|
||||||
|
// NewZoneCache creates a zoneCache.
|
||||||
func NewZoneCache() *zoneCache {
|
func NewZoneCache() *zoneCache {
|
||||||
return &zoneCache{}
|
return &zoneCache{}
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
* [NewRegistrar](language-reference/top-level-functions/NewRegistrar.md)
|
* [NewRegistrar](language-reference/top-level-functions/NewRegistrar.md)
|
||||||
* [PANIC](language-reference/top-level-functions/PANIC.md)
|
* [PANIC](language-reference/top-level-functions/PANIC.md)
|
||||||
* [REV](language-reference/top-level-functions/REV.md)
|
* [REV](language-reference/top-level-functions/REV.md)
|
||||||
|
* [REVCOMPAT](language-reference/top-level-functions/REVCOMPAT.md)
|
||||||
* [getConfiguredDomains](language-reference/top-level-functions/getConfiguredDomains.md)
|
* [getConfiguredDomains](language-reference/top-level-functions/getConfiguredDomains.md)
|
||||||
* [require](language-reference/top-level-functions/require.md)
|
* [require](language-reference/top-level-functions/require.md)
|
||||||
* [require_glob](language-reference/top-level-functions/require_glob.md)
|
* [require_glob](language-reference/top-level-functions/require_glob.md)
|
||||||
|
@ -150,6 +150,7 @@ func (dc *DomainConfig) Punycode() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// StoreCorrections accumulates corrections in a thread-safe way.
|
||||||
func (dc *DomainConfig) StoreCorrections(providerName string, corrections []*Correction) {
|
func (dc *DomainConfig) StoreCorrections(providerName string, corrections []*Correction) {
|
||||||
dc.pendingCorrectionsMutex.Lock()
|
dc.pendingCorrectionsMutex.Lock()
|
||||||
defer dc.pendingCorrectionsMutex.Unlock()
|
defer dc.pendingCorrectionsMutex.Unlock()
|
||||||
@ -171,6 +172,7 @@ func (dc *DomainConfig) StoreCorrections(providerName string, corrections []*Cor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetCorrections returns the accumulated corrections for providerName.
|
||||||
func (dc *DomainConfig) GetCorrections(providerName string) []*Correction {
|
func (dc *DomainConfig) GetCorrections(providerName string) []*Correction {
|
||||||
dc.pendingCorrectionsMutex.Lock()
|
dc.pendingCorrectionsMutex.Lock()
|
||||||
defer dc.pendingCorrectionsMutex.Unlock()
|
defer dc.pendingCorrectionsMutex.Unlock()
|
||||||
|
@ -497,6 +497,7 @@ func (rc *RecordConfig) Key() RecordKey {
|
|||||||
return RecordKey{rc.NameFQDN, t}
|
return RecordKey{rc.NameFQDN, t}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetSVCBValue returns the SVCB Key/Values as a list of Key/Values.
|
||||||
func (rc *RecordConfig) GetSVCBValue() []dns.SVCBKeyValue {
|
func (rc *RecordConfig) GetSVCBValue() []dns.SVCBKeyValue {
|
||||||
record, err := dns.NewRR(fmt.Sprintf("%s %s %d %s %s", rc.NameFQDN, rc.Type, rc.SvcPriority, rc.target, rc.SvcParams))
|
record, err := dns.NewRR(fmt.Sprintf("%s %s %d %s %s", rc.NameFQDN, rc.Type, rc.SvcPriority, rc.target, rc.SvcParams))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package models
|
package models
|
||||||
|
|
||||||
|
// MakeUnknown turns an RecordConfig into an UNKNOWN type.
|
||||||
func MakeUnknown(rc *RecordConfig, rtype string, contents string, origin string) error {
|
func MakeUnknown(rc *RecordConfig, rtype string, contents string, origin string) error {
|
||||||
rc.Type = "UNKNOWN"
|
rc.Type = "UNKNOWN"
|
||||||
rc.UnknownTypeName = rtype
|
rc.UnknownTypeName = rtype
|
||||||
|
@ -8,6 +8,7 @@ import (
|
|||||||
var newmode bool
|
var newmode bool
|
||||||
var modeset bool
|
var modeset bool
|
||||||
|
|
||||||
|
// SetCompatibilityMode sets REV() compatibility mode.
|
||||||
func SetCompatibilityMode(m string) error {
|
func SetCompatibilityMode(m string) error {
|
||||||
if modeset {
|
if modeset {
|
||||||
return fmt.Errorf("ERROR: REVCOMPAT() already set")
|
return fmt.Errorf("ERROR: REVCOMPAT() already set")
|
||||||
@ -25,16 +26,20 @@ func SetCompatibilityMode(m string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IsRFC4183Mode returns true if REV() is in RFC4183 mode.
|
||||||
func IsRFC4183Mode() bool {
|
func IsRFC4183Mode() bool {
|
||||||
return newmode
|
return newmode
|
||||||
}
|
}
|
||||||
|
|
||||||
var warningNeeded bool = false
|
var warningNeeded bool = false
|
||||||
|
|
||||||
|
// NeedsWarning sets that a future warning regarding RFC2317
|
||||||
|
// compatibility is needed.
|
||||||
func NeedsWarning() {
|
func NeedsWarning() {
|
||||||
warningNeeded = true
|
warningNeeded = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PrintWarning prints a warning if a warning related to RFC2317 is needed.
|
||||||
func PrintWarning() {
|
func PrintWarning() {
|
||||||
if modeset {
|
if modeset {
|
||||||
// No warnings if REVCOMPAT() was used.
|
// No warnings if REVCOMPAT() was used.
|
||||||
|
Reference in New Issue
Block a user