Documentation
¶
Overview ¶
Package config handles loading configuration from .gonerc.yaml files.
Index ¶
Constants ¶
const DefaultConfigFileName = ".gonerc.yaml"
DefaultConfigFileName is the default configuration file name.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Ignore IgnoreConfig `yaml:"ignore"`
}
Config represents the complete configuration structure.
func FindAndLoad ¶
FindAndLoad searches for a config file starting from the given directory and walking up to parent directories until it finds one or reaches root. This allows project-specific configs to be found from subdirectories.
func Load ¶
Load reads configuration from .gonerc.yaml in the current directory. Returns an empty config if the file doesn't exist (not an error). Returns an error only if the file exists but cannot be parsed.
func LoadFrom ¶
LoadFrom reads configuration from a specific path. Returns an empty config if the file doesn't exist (not an error). Returns an error only if the file exists but cannot be parsed.
type IgnoreConfig ¶
type IgnoreConfig struct {
// Domains to ignore (automatically includes subdomains).
// Example: "example.com" will also match "www.example.com", "api.example.com".
Domains []string `yaml:"domains"`
// Patterns are glob patterns for URL matching.
// Example: "*.local/*", "*/internal/*"
Patterns []string `yaml:"patterns"`
// Regex are regular expression patterns for URL matching.
// Example: ".*\\.test$", ".*/v[0-9]+/draft/.*"
Regex []string `yaml:"regex"`
}
IgnoreConfig holds all ignore rules.