Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Meta ¶
type Meta struct { Scraping Scraping `yaml:"scraping"` EmailSettings email.UserConfig `yaml:"email"` LinkSources []linksrc.Config `yaml:"link_sources"` }
Meta represents all current config options that the application can use, i.e., after validation and parsing
func Parse ¶
Parse generates usable configurations from possibly arbitrary user input. An error indicates a problem with parsing or validation. The Reader r can be either JSON or YAML.
func (*Meta) CheckAndSetDefaults ¶
CheckAndSetDefaults validates m and either returns a copy of m with default settings applied or returns an error due to an invalid configuration
type Scraping ¶
type Scraping struct { Interval time.Duration StorageDirPath string // Run the scraper once, then exit OneOff bool // Print the HTML body of a single email to stdout and exit to help test // configuration. TestMode bool // Number of days we keep a link in the database before marking it // expired. LinkExpiryDays uint }
Scraping contains config options that apply to One Newsletter's scraping behavior
func (*Scraping) CheckAndSetDefaults ¶
CheckAndSetDefaults validates s and either returns a copy of s with default settings applied or returns an error due to an invalid configuration
func (*Scraping) UnmarshalYAML ¶
UnmarshalYAML parses a user-provided YAML configuration, returning any parsing errors.