Documentation
¶
Overview ¶
Package config provides Leakwatch configuration management.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Scan ScanConfig `mapstructure:"scan"`
Detection DetectionConfig `mapstructure:"detection"`
Verification VerificationConfig `mapstructure:"verification"`
Filter FilterConfig `mapstructure:"filter"`
Output OutputConfig `mapstructure:"output"`
CustomRules []custom.RuleDef `mapstructure:"custom-rules"`
}
Config represents the complete application configuration.
func LoadFrom ¶
LoadFrom reads configuration from a specific Viper instance and returns a validated Config. Each scan command builds its own isolated Viper (see cmd/scan_common.go) and passes it here, which keeps one command's bound flag defaults from leaking into another command's resolved configuration.
type DetectionConfig ¶
type DetectionConfig struct {
Entropy EntropyConfig `mapstructure:"entropy"`
}
DetectionConfig holds detection configuration.
type EntropyConfig ¶
type EntropyConfig struct {
Enabled bool `mapstructure:"enabled"`
Threshold float64 `mapstructure:"threshold"`
}
EntropyConfig holds entropy analysis configuration.
type FilterConfig ¶
type FilterConfig struct {
ExcludePaths []string `mapstructure:"exclude-paths"`
ExcludeDetectors []string `mapstructure:"exclude-detectors"`
}
FilterConfig holds filtering configuration.
type OutputConfig ¶
type OutputConfig struct {
Format string `mapstructure:"format"`
File string `mapstructure:"file"`
SeverityThreshold string `mapstructure:"severity-threshold"`
ShowRaw bool `mapstructure:"show-raw"`
}
OutputConfig holds output configuration.
type ScanConfig ¶
type ScanConfig struct {
Concurrency int `mapstructure:"concurrency"`
MaxFileSize int64 `mapstructure:"max-file-size"`
}
ScanConfig holds scan engine configuration.