config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultConfig is the top-level configuration.
	DefaultConfig = Config{
		GlobalConfig: DefaultGlobalConfig,
	}

	// DefaultGlobalConfig is the default global configuration.
	DefaultGlobalConfig = GlobalConfig{
		Interval:  time.Hour,
		RateLimit: 1.25,
	}

	// DefaultDomainConfig is the default domain configuration.
	DefaultDomainConfig = DomainConfig{
		IncludeSubdomains: false,
	}
)

Functions

This section is empty.

Types

type Config

type Config struct {
	GlobalConfig  GlobalConfig    `yaml:"global"`
	DomainConfigs []*DomainConfig `yaml:"domains"`
	FileConfigs   []*FileConfig   `yaml:"files"`
}

Config is the top-level configuration.

func Load

func Load(data string) (*Config, error)

Load parses the YAML input s into a Config.

func LoadFile

func LoadFile(filename string) (*Config, error)

LoadFile parses the given YAML file into a Config.

type DomainConfig

type DomainConfig struct {
	// Domain to use for requesting certificate issuances.
	Domain string `yaml:"domain"`
	// If sub domains should be included.
	IncludeSubdomains bool `yaml:"include_subdomains"`
}

DomainConfig configures domain requesting options.

func (*DomainConfig) UnmarshalYAML

func (c *DomainConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

type FileConfig

type FileConfig struct {
	// Filename to export targets to
	File string `yaml:"file"`
	// Labels to add to targets before export
	Labels map[string]string `yaml:"labels"`
	// Matches for target to be included in file
	MatchRE MatchRE `yaml:"match_re"`
}

FileConfig configure a file for exporting issuances.

type GlobalConfig

type GlobalConfig struct {
	// Interval to use between polling the certspotter api.
	Interval time.Duration `yaml:"polling_interval"`
	// RateLimit to use for certspotter api (configured in Hz).
	RateLimit float64 `yaml:"rate_limit"`
	// Token to used for authenticating againts certspotter api.
	Token string `yaml:"token"`
}

GlobalConfig configures globally shared values.

func (*GlobalConfig) UnmarshalYAML

func (c *GlobalConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

type MatchRE

type MatchRE map[string]*regexp.Regexp

MatchRE represents a map of regex patterns

func (*MatchRE) UnmarshalYAML

func (m *MatchRE) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

Jump to

Keyboard shortcuts

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