Documentation
¶
Index ¶
- func ApplyDefaults(cfg *Config, paths *Paths) error
- func ApplyEnv(cfg *Config, getenv func(string) string) error
- func Save(path string, cfg *Config) error
- func Validate(cfg *Config) error
- type Config
- type Crawl
- type Env
- type Output
- type Paths
- func (p *Paths) AcquisitionCacheDir() (string, error)
- func (p *Paths) CacheDir() (string, error)
- func (p *Paths) ConfigDir() (string, error)
- func (p *Paths) ConfigFile() (string, error)
- func (p *Paths) DataDir() (string, error)
- func (p *Paths) DatabasePath() (string, error)
- func (p *Paths) HomeDir() string
- func (p *Paths) LogDir() (string, error)
- func (p *Paths) StateDir() (string, error)
- type TokenSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyDefaults ¶
ApplyDefaults fills zero-valued fields with defaults and resolves the database path against paths when it is unset.
func ApplyEnv ¶
ApplyEnv overrides cfg fields from environment variables. The getter may be os.Getenv or an injected map for tests.
Types ¶
type Config ¶
type Config struct {
Database string `toml:"database,omitempty"`
TokenSource TokenSource `toml:"token_source,omitempty"`
Crawl Crawl `toml:"crawl,omitempty"`
Output Output `toml:"output,omitempty"`
}
Config is the typed TOML application configuration. It never stores raw GitHub tokens; only a token source descriptor.
func Default ¶
func Default() *Config
Default returns a Config populated with built-in defaults. Database and paths are left empty so that ApplyDefaults can resolve them against Paths.
type Crawl ¶
type Crawl struct {
Budget int `toml:"budget"`
Concurrency int `toml:"concurrency"`
RetryLimit int `toml:"retry_limit"`
Timeout string `toml:"timeout,omitempty"`
}
Crawl holds crawl budgets and concurrency limits.
type Env ¶
Env provides an injectable environment for tests. A nil Env uses the real process environment and home directory.
type Paths ¶
Paths resolves platform-native application directories.
func NewPaths ¶
NewPaths returns a Paths resolver for the current platform using env for environment injection. If env is nil, the real process environment is used.
func (*Paths) AcquisitionCacheDir ¶
AcquisitionCacheDir returns the managed code-acquisition cache directory.
func (*Paths) ConfigDir ¶
ConfigDir returns the platform-native configuration directory for the app.
func (*Paths) ConfigFile ¶
ConfigFile returns the full path to the configuration file.
func (*Paths) DatabasePath ¶
DatabasePath returns the default database path inside DataDir.
func (*Paths) HomeDir ¶
HomeDir returns the configured user home used for coding-client discovery. It honors the injected environment used by tests.
type TokenSource ¶
TokenSource describes how to obtain a GitHub token. The token itself is never persisted here.