Documentation
¶
Overview ¶
Package libdctlint provides a library to check/lint Domain Connect service provider template.
Check results are communicated via zerolog messages in interactive mode, or via a DCTLMessage list when library mode is active (SetLib(true)).
Index ¶
- Constants
- func ProjectVersion() uint
- type Conf
- func (conf *Conf) CheckTemplate(f *bufio.Reader) exitvals.CheckSeverity
- func (conf *Conf) GetAndCheckTemplate(f *bufio.Reader) (internal.Template, exitvals.CheckSeverity)
- func (c *Conf) GetMessages() []DCTLMessage
- func (c *Conf) GetToleration() zerolog.Level
- func (c *Conf) SetCheckLogos(b bool) *Conf
- func (c *Conf) SetCloudflare(b bool) *Conf
- func (c *Conf) SetFilename(fn string) *Conf
- func (c *Conf) SetIncrement(b bool) *Conf
- func (c *Conf) SetIndent(i uint) *Conf
- func (c *Conf) SetInplace(b bool) *Conf
- func (c *Conf) SetLib(b bool) *Conf
- func (c *Conf) SetLogger(l zerolog.Logger) *Conf
- func (c *Conf) SetMergeOrFail(b bool) *Conf
- func (c *Conf) SetPrettyPrint(b bool) *Conf
- func (c *Conf) SetTTL(t uint32) *Conf
- func (c *Conf) SetToleration(s string) *Conf
- type DCTLMessage
Constants ¶
const ( TypeNS uint16 = 2 TypeCNAME uint16 = 5 TypeNULL uint16 = 10 TypeTXT uint16 = 16 TypeSRV uint16 = 33 TypeTLSA uint16 = 52 TypeSMIMEA uint16 = 53 TypeOPENPGPKEY uint16 = 61 TypeSVCB uint16 = 64 TypeHTTPS uint16 = 65 TypeURI uint16 = 256 )
const MaxTTL = (1 << 31) - 1 // 2147483647
Variables ¶
This section is empty.
Functions ¶
func ProjectVersion ¶
func ProjectVersion() uint
ProjectVersion returns the dc-template-linter project version number.
Types ¶
type Conf ¶
type Conf struct {
// contains filtered or unexported fields
}
Conf holds template checking instructions. The field type FileName must be updated each time CheckTemplate() is called to match with the bufio.Reader argument.
func (*Conf) CheckTemplate ¶
func (conf *Conf) CheckTemplate(f *bufio.Reader) exitvals.CheckSeverity
CheckTemplate takes bufio.Reader as an argument and will run template checks according to the Conf configuration. Please remember to set conf.fileName appropriately before calling this function to avoid confusing results.
In library mode (SetLib(true)) all DCTL messages are stored and accessible via GetMessages() after this call returns.
func (*Conf) GetAndCheckTemplate ¶
GetAndCheckTemplate is used in dctweb. Do not use applications outside of this project.
func (*Conf) GetMessages ¶
func (c *Conf) GetMessages() []DCTLMessage
GetMessages returns the list of DCTL messages captured during the most recent CheckTemplate() call when library mode is active (SetLib(true)). The slice is reset at the start of each CheckTemplate() call.
func (*Conf) GetToleration ¶
func (*Conf) SetCheckLogos ¶
func (*Conf) SetCloudflare ¶
func (*Conf) SetFilename ¶
func (*Conf) SetIncrement ¶
func (*Conf) SetInplace ¶
func (*Conf) SetLib ¶
SetLib enables or disables library mode. When enabled, CheckTemplate() captures DCTL messages to an internal list instead of writing to the zerolog global logger. Captured messages are accessible via GetMessages().
func (*Conf) SetMergeOrFail ¶
func (*Conf) SetPrettyPrint ¶
func (*Conf) SetToleration ¶
type DCTLMessage ¶
DCTLMessage holds a captured linting message produced during a library-mode template check. Code is the DCTL code that triggered the message, Level is its zerolog severity, and Message is the JSON-encoded zerolog event string.