config

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppOptions

type AppOptions struct {
	ConfigPath flags.Filename `short:"c" long:"config" description:"Path to Gudgeon configuration file."`
}

type DebugOptions added in v0.3.16

type DebugOptions struct {
	Profile bool `short:"P" long:"profile" description:"Enable GOPS profiling at runtime."`
}

type GudgeonConfig

type GudgeonConfig struct {
	Home      string             `yaml:"home"`
	Storage   *GudgeonStorage    `yaml:"storage"`
	Metrics   *GudgeonMetrics    `yaml:"metrics"`
	QueryLog  *GudgeonQueryLog   `yaml:"query_log"`
	Network   *GudgeonNetwork    `yaml:"network"`
	Web       *GudgeonWeb        `yaml:"web"`
	Resolvers []*GudgeonResolver `yaml:"resolvers"`
	Lists     []*GudgeonList     `yaml:"lists"`
	Groups    []*GudgeonGroup    `yaml:"groups"`
	Consumers []*GudgeonConsumer `yaml:"consumers"`
	// contains filtered or unexported fields
}

func Load

func Load(filename string) (*GudgeonConfig, []string, error)

func (*GudgeonConfig) CacheRoot

func (config *GudgeonConfig) CacheRoot() string

func (*GudgeonConfig) DataRoot added in v0.3.0

func (config *GudgeonConfig) DataRoot() string

func (*GudgeonConfig) GetConsumer added in v0.3.14

func (conf *GudgeonConfig) GetConsumer(name string) *GudgeonConsumer

func (*GudgeonConfig) GetGroup added in v0.3.14

func (conf *GudgeonConfig) GetGroup(name string) *GudgeonGroup

func (*GudgeonConfig) GetList added in v0.3.14

func (conf *GudgeonConfig) GetList(name string) *GudgeonList

func (*GudgeonConfig) GetResolver added in v0.3.14

func (conf *GudgeonConfig) GetResolver(name string) *GudgeonResolver

func (*GudgeonConfig) PathToList

func (config *GudgeonConfig) PathToList(list *GudgeonList) string

func (*GudgeonConfig) SessionRoot

func (config *GudgeonConfig) SessionRoot() string

type GudgeonConsumer added in v0.3.14

type GudgeonConsumer struct {
	Name    string          `yaml:"name"`
	Block   bool            `yaml:"block"`
	Groups  []string        `yaml:"groups"`
	Matches []*GudgeonMatch `yaml:"matches"`
}

type GudgeonGroup

type GudgeonGroup struct {
	// name: name of the group
	Name string `yaml:"name"`
	// inherit: list of groups to copy settings from
	Inherit []string `yaml:"inherit"`
	// resolvers: resolvers to use for this group
	Resolvers []string `yaml:"resolvers"`
	// lists: names of blocklists to apply
	Lists []string `yaml:"lists"`
	// tags: tags to use for tag-based matching
	Tags *[]string `yaml:"tags"`
}

groups: ties end-users (consumers) to various lists.

func (*GudgeonGroup) SafeTags added in v0.3.14

func (list *GudgeonGroup) SafeTags() []string

type GudgeonInterface

type GudgeonInterface struct {
	// the IP of the interface. The interface 0.0.0.0 means "all"
	IP string `yaml:"ip"`
	// The port to listen on (on the given interface), defaults to 53
	Port int `yaml:"port"`
	// Should this port listen on TCP? (defaults to the value of Network.TCP which defaults to true)
	TCP *bool `yaml:"tcp"`
	// Should this port listen on UDP? (defaults to the value of Network.UDP which defaults to true)
	UDP *bool `yaml:"udp"`
	// TLS settings
	TLS *GudgeonTLS `yaml:"tls"`
}

network interface information

type GudgeonList

type GudgeonList struct {
	// the name of the list
	Name string `yaml:"name"`
	// the type of the list, requires "allow" or "block", defaults to "block"
	Type string `yaml:"type"`
	// the tags that relate to the list for tag filtering/processing
	Tags *[]string `yaml:"tags"`
	// the path to the list, remote paths will be downloaded if possible
	Source string `yaml:"src"`
}

blocklists, blacklists, whitelists: different types of lists for domains that gudgeon will evaluate

func (*GudgeonList) CanonicalName

func (list *GudgeonList) CanonicalName() string

simple function to get source as name if name is missing

func (*GudgeonList) IsRemote

func (list *GudgeonList) IsRemote() bool

func (*GudgeonList) SafeTags added in v0.3.14

func (list *GudgeonList) SafeTags() []string

func (*GudgeonList) ShortName added in v0.2.2

func (list *GudgeonList) ShortName() string

type GudgeonMatch

type GudgeonMatch struct {
	IP    string             `yaml:"ip"`
	Range *GudgeonMatchRange `yaml:"range"`
	Net   string             `yaml:"net"`
}

type GudgeonMatchRange

type GudgeonMatchRange struct {
	Start string `yaml:"start"`
	End   string `yaml:"end"`
}

range: an IP range for consumer matching

type GudgeonMetrics added in v0.3.0

type GudgeonMetrics struct {
	Enabled  *bool  `yaml:"enabled"`
	Persist  *bool  `yaml:"persist"`
	Duration string `yaml:"duration"`
	Interval string `yaml:"interval"`
}

type GudgeonNetwork

type GudgeonNetwork struct {
	// Global TLS settings
	TLS *GudgeonTLS `yaml:"tls"`
	// tcp: true when the default for all interfaces is to use tcp
	TCP *bool `yaml:"tcp"`
	// udp: true when the default for all interfaces is to use udp
	UDP *bool `yaml:"udp"`
	// systemd: also accept listeners request from systemd
	Systemd *bool `yaml:"systemd"`
	// endpoints: list of string endpoints that should have dns
	Interfaces []*GudgeonInterface `yaml:"interfaces"`
}

network: general dns network configuration

type GudgeonOptions

type GudgeonOptions struct {
	// explicit app group
	AppOptions AppOptions `group:"Application Options"`

	// debug/performance/profiling options
	DebugOptions DebugOptions `group:"Debugging/Profiling Options"`

	// emulate help flag with direct support for accessing it
	HelpOptions HelpOptions `group:"Help Options"`
}

func Options

func Options(longVersion string) (GudgeonOptions, error)

type GudgeonQueryLog added in v0.3.0

type GudgeonQueryLog struct {
	Enabled       *bool  `yaml:"enabled"`
	Persist       *bool  `yaml:"persist"`
	Duration      string `yaml:"duration"`
	Stdout        *bool  `yaml:"stdout"`
	File          string `yaml:"file"`
	QueueSize     int    `yaml:"queue"`
	BatchInterval string `yaml:"interval"`
	ReverseLookup *bool  `yaml:"lookup"`
	MdnsLookup    *bool  `yaml:"mdns"`
	NetbiosLookup *bool  `yaml:"netbios"`
}

type GudgeonResolver

type GudgeonResolver struct {
	// name of the resolver
	Name string `yaml:"name"`
	// domains to operate on
	Domains []string `yaml:"domains"`
	// domains to skip
	SkipDomains []string `yaml:"skip"`
	// search domains, will retry resolution using these subdomains if the domain is not found
	Search []string `yaml:"search"`
	// manual hosts
	Hosts []string `yaml:"hosts"`
	// sources (described via string)
	Sources []string `yaml:"sources"`
}

a resolver is composed of a list of sources to get DNS information from

type GudgeonRoot

type GudgeonRoot struct {
	Config *GudgeonConfig `yaml:"gudgeon"`
}

type GudgeonStorage added in v0.3.13

type GudgeonStorage struct {
	// rule storage is used by the rule storage engine to decide which implementation to use
	// values are like 'memory', 'sqlite', 'hash32', etc
	RuleStorage string `yaml:"rules"`
	// you can enable/disable the cache here, default is to enable
	CacheEnabled *bool `yaml:"cache"`
}

GudgeonStorage defines the different storage types for persistent/session data

type GudgeonTLS added in v0.1.7

type GudgeonTLS struct {
	Enabled bool `yaml:"enabled"`
}

type GudgeonWeb added in v0.2.2

type GudgeonWeb struct {
	Enabled bool   `yaml:"enabled"`
	Address string `yaml:"address"`
	Port    int    `yaml:"port"`
}

type HelpOptions

type HelpOptions struct {
	Help    bool `short:"h" long:"help" group:"Help options" description:"Show this help message."`
	Version bool `short:"v" long:"version" description:"Print the version of the software."`
}

Jump to

Keyboard shortcuts

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