Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
DBURL string `yaml:"db_url"`
Schemas []string `yaml:"schemas"`
Thresholds Thresholds `yaml:"thresholds"`
Exclude Exclude `yaml:"exclude"`
Defaults Defaults `yaml:"defaults"`
}
Config holds all pgspectre configuration.
func Load ¶
Load reads configuration from .pgspectre.yml in the given directory, falling back to ~/.pgspectre.yml. Returns DefaultConfig if no file found.
func (*Config) TimeoutDuration ¶
TimeoutDuration parses the Defaults.Timeout string as a time.Duration. Returns 30s if parsing fails.
type Defaults ¶
type Defaults struct {
Format string `yaml:"format"`
Timeout string `yaml:"timeout"` // parsed as time.Duration
}
Defaults holds default CLI flag values.
type Exclude ¶
type Exclude struct {
Tables []string `yaml:"tables"`
Schemas []string `yaml:"schemas"`
Findings []string `yaml:"findings"`
}
Exclude lists tables, schemas, and finding types to skip during analysis.
type Thresholds ¶
type Thresholds struct {
VacuumDays int `yaml:"vacuum_days"` // days since last autovacuum to flag
UnusedIndexMinBytes int64 `yaml:"unused_index_min_bytes"` // minimum unused index size to report
BloatMinBytes int64 `yaml:"bloat_min_bytes"` // minimum index size to flag as bloated
}
Thresholds control detection sensitivity.
Click to show internal directories.
Click to hide internal directories.