Documentation
¶
Overview ¶
Package config loads refetch's settings: defaults, then ~/.config/refetch/config.toml, then REFETCH_* environment variables, so the plugin's hooks, its MCP server and the CLI read the same switches.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Impersonate string `toml:"impersonate"` // always, fallback or off
Render string `toml:"render"` // auto or off (headless Chrome step)
RenderTimeout Duration `toml:"render_timeout"` // hard cap for the headless Chrome step
Timeout Duration `toml:"timeout"` // per HTTP client
RespectRobots bool `toml:"respect_robots"` // consult robots.txt
Stats bool `toml:"stats"` // record events.db rows
Mode string `toml:"mode"` // nudge or inline (hook response)
UserAgent string `toml:"user_agent"` // the plain client's User-Agent; empty = refetch/<version>
UseProxy bool `toml:"use_proxy"` // connect through HTTPS_PROXY; a TLS-decrypting one replaces the Chrome handshake
Archive string `toml:"archive"` // wayback or off: look a page that cannot be read up at archive.org
}
Config holds every switch. The zero value is not valid; use Default or Load.
func Default ¶
func Default() Config
Default is the configuration with nothing set: everything on, robots off.
type Duration ¶
Duration is a time.Duration written as "10s" in TOML and env vars.
func (Duration) MarshalText ¶
MarshalText writes the duration as a Go duration string.
func (*Duration) UnmarshalText ¶
UnmarshalText parses a Go duration string.