config

package
v0.0.0-...-8375cc0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2016 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TOMLSource

func TOMLSource(dflt, key string) func(*cli.Context) (altsrc.InputSourceContext, error)

Types

type BlockConfig

type BlockConfig struct {
	IPv4      IP          `toml:"ipv4"`
	IPv6      IP          `toml:"ipv6"`
	TTL       Duration    `toml:"ttl"`
	WhiteList StringSlice `toml:"whitelist"`
}

func NewBlockConfig

func NewBlockConfig() *BlockConfig

func (*BlockConfig) Flags

func (c *BlockConfig) Flags(prefix string) []cli.Flag

type Config

type Config struct {
	CacheDir        string     `toml:"cache_dir"`
	ListenPixelserv string     `toml:"listen_pixelserv"`
	ListenAPIServer string     `toml:"listen_apiserver"`
	Log             *LogConfig `toml:"log"`
	DL              *DLConfig  `toml:"dl"`
	DNS             *DNSConfig `toml:"dns"`
}

func New

func New() *Config

func (*Config) Flags

func (c *Config) Flags() []cli.Flag

type DLConfig

type DLConfig struct {
	UpdateInterval Duration    `toml:"update_interval"`
	Hosts          StringSlice `toml:"hosts"`
	Domains        StringSlice `toml:"domains"`
	DebugHTTP      bool        `toml:"debug_http"`
}

func NewDLConfig

func NewDLConfig() *DLConfig

func (*DLConfig) Flags

func (c *DLConfig) Flags(prefix string) []cli.Flag

type DNSCacheConfig

type DNSCacheConfig struct {
	PruneInterval Duration `toml:"prune_interval"`
	Disable       bool     `toml:"disable"`
	Size          int      `toml:"size"`
}

func NewDNSCacheConfig

func NewDNSCacheConfig() *DNSCacheConfig

func (*DNSCacheConfig) Flags

func (c *DNSCacheConfig) Flags(prefix string) []cli.Flag

type DNSConfig

type DNSConfig struct {
	Listen         StringSlice          `toml:"listen"`
	Block          *BlockConfig         `toml:"block"`
	ClientTimeout  Duration             `toml:"client_timeout"`
	ServerTimeout  Duration             `toml:"server_timeout"`
	DialTimeout    Duration             `toml:"dial_timeout"`
	LookupInterval Duration             `toml:"lookup_interval"`
	Cache          *DNSCacheConfig      `toml:"cache"`
	Forward        StringSlice          `toml:"forward"`
	Zone           DNSZones             `toml:"zone"`
	Override       StringMapStringSlice `toml:"override"`
	OverrideTTL    Duration             `toml:"override_ttl"`
	HTTP           DNSHTTPConfig
}

func NewDNSConfig

func NewDNSConfig() *DNSConfig

func (*DNSConfig) Flags

func (c *DNSConfig) Flags(prefix string) []cli.Flag

type DNSHTTPConfig

type DNSHTTPConfig struct {
	KeepAlive             Duration `toml:"keep_alive"`
	MaxIdleConns          int      `toml:"max_idle_conns"`
	MaxIdleConnsPerHost   int      `toml:"max_idle_conns_per_host"`
	IdleConnTimeout       Duration `toml:"idle_conn_timeout"`
	TLSHandshakeTimeout   Duration `toml:"tls_handshake_timeout"`
	ExpectContinueTimeout Duration `toml:"expect_continue_timeout"`
	NoDNSSEC              bool     `toml:"no_dnssec"`
	EDNSClientSubnet      string   `toml:"edns_client_subnet"`
	NoRandomPadding       bool     `toml:"no_random_padding"`
}

type DNSZone

type DNSZone struct {
	Name string   `toml:"name" json:"name"`
	Addr []string `toml:"addr" json:"addr"`
}

type DNSZones

type DNSZones []DNSZone

func (DNSZones) Generic

func (z DNSZones) Generic() cli.Generic

func (*DNSZones) Set

func (z *DNSZones) Set(value string) error

func (DNSZones) String

func (z DNSZones) String() string

type Duration

type Duration time.Duration

func (Duration) Generic

func (d Duration) Generic() cli.Generic

func (Duration) MarshalText

func (d Duration) MarshalText() ([]byte, error)

func (*Duration) Set

func (d *Duration) Set(value string) error

func (Duration) String

func (d Duration) String() string

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(text []byte) error

func (Duration) Value

func (d Duration) Value() time.Duration

type IP

type IP net.IP

func ParseIP

func ParseIP(value string) IP

func (IP) Generic

func (i IP) Generic() cli.Generic

func (IP) MarshalText

func (i IP) MarshalText() ([]byte, error)

func (*IP) Set

func (i *IP) Set(value string) error

func (IP) String

func (i IP) String() string

func (*IP) UnmarshalText

func (i *IP) UnmarshalText(text []byte) error

func (IP) Value

func (i IP) Value() net.IP

type LogConfig

type LogConfig struct {
	File  string `toml:"file"`
	Level string `toml:"level"`
	JSON  bool   `toml:"json"`
}

func NewLogConfig

func NewLogConfig() *LogConfig

func (*LogConfig) Flags

func (c *LogConfig) Flags(prefix string) []cli.Flag

type StringMapStringSlice

type StringMapStringSlice map[string][]string

func (StringMapStringSlice) Generic

func (m StringMapStringSlice) Generic() cli.Generic

func (*StringMapStringSlice) Set

func (m *StringMapStringSlice) Set(value string) error

func (StringMapStringSlice) String

func (m StringMapStringSlice) String() string

type StringSlice

type StringSlice []string

StringSlice is an opaque type for []string to satisfy flag.Value

func (StringSlice) Generic

func (f StringSlice) Generic() cli.Generic

func (*StringSlice) Set

func (f *StringSlice) Set(value string) error

Set the string value to the comma separated list of values

func (*StringSlice) String

func (f *StringSlice) String() string

String returns a readable representation of this value (for usage defaults)

func (*StringSlice) Value

func (f *StringSlice) Value() []string

Value returns the slice of strings set by this flag

Jump to

Keyboard shortcuts

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