config

package
v0.0.0-...-e4cb65c Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Servers []string         `yaml:"servers"`
	Zones   map[string]*Zone `yaml:"zones"`
	GSS     *GSSConfig       `yaml:"gss"`
}

func ReadConfig

func ReadConfig(path string) (*Config, error)

Read the config from the file, overriding with env variables, and filling defaults.

func (*Config) Validate

func (c *Config) Validate() error

type GSSConfig

type GSSConfig struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
	Domain   string `yaml:"domain"`
}

func (*GSSConfig) Validate

func (c *GSSConfig) Validate() error

type MXRecord

type MXRecord struct {
	Preference uint16 `yaml:"preference"`
	MX         string `yaml:"mx"`
}

type Record

type Record struct {
	FQDN  string
	Host  []netip.Addr `yaml:"host"`
	TXT   []string     `yaml:"txt"`
	MX    []MXRecord   `yaml:"mx"`
	SRV   []SRVRecord  `yaml:"srv"`
	CNAME string       `yaml:"cname"`
	TTL   uint32       `yaml:"ttl"`
}

func (*Record) Records

func (r *Record) Records() []dns.RR

func (*Record) Validate

func (r *Record) Validate() error

type SRVRecord

type SRVRecord struct {
	Priority uint16 `yaml:"priority"`
	Weight   uint16 `yaml:"weight"`
	Port     uint16 `yaml:"port"`
	Target   string `yaml:"target"`
}

type Zone

type Zone struct {
	Records map[string]*Record `yaml:"records"`
	TTL     uint32             `yaml:"ttl"`
}

func (*Zone) Validate

func (z *Zone) Validate() error

Jump to

Keyboard shortcuts

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