Documentation
¶
Overview ¶
Package config provides YAML configuration file support for multi-fabric collection.
Index ¶
- type Config
- type FabricConfig
- func (f *FabricConfig) GetBatchSize() int
- func (f *FabricConfig) GetClass() string
- func (f *FabricConfig) GetConfirm() bool
- func (f *FabricConfig) GetFabricName() string
- func (f *FabricConfig) GetOutputFileName() string
- func (f *FabricConfig) GetPageSize() int
- func (f *FabricConfig) GetRequestRetryCount() int
- func (f *FabricConfig) GetRetryDelay() int
- func (f *FabricConfig) GetSSHPort() int
- func (f *FabricConfig) GetVerbose() bool
- func (f *FabricConfig) MergeWithGlobal(global GlobalConfig) FabricConfig
- type GlobalConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Global GlobalConfig `yaml:"global"`
Fabrics []FabricConfig `yaml:"fabrics"`
}
Config represents the full YAML configuration file structure.
func LoadConfig ¶
LoadConfig reads and parses a YAML configuration file.
func ParseConfig ¶
ParseConfig reads and parses a YAML configuration file without prompting.
func (*Config) ApplyDefaults ¶
func (c *Config) ApplyDefaults()
ApplyDefaults sets global defaults for missing values.
func (*Config) NormalizeAndPrompt ¶
NormalizeAndPrompt fills missing values and normalizes inputs.
type FabricConfig ¶
type FabricConfig struct {
Name string `yaml:"name"`
URL string `yaml:"url"`
Output string `yaml:"output"`
Username string `yaml:"username"`
Password string `yaml:"password"`
RequestRetryCount *int `yaml:"request_retry_count"`
RetryDelay *int `yaml:"retry_delay"`
BatchSize *int `yaml:"batch_size"`
PageSize *int `yaml:"page_size"`
Confirm *bool `yaml:"confirm"`
Verbose *bool `yaml:"verbose"`
Class string `yaml:"class"`
Query map[string]string `yaml:"query"`
SSHPort *int `yaml:"ssh_port"`
}
FabricConfig holds per-fabric configuration.
func (*FabricConfig) GetBatchSize ¶
func (f *FabricConfig) GetBatchSize() int
GetBatchSize returns the batch size with fallback to default.
func (*FabricConfig) GetClass ¶
func (f *FabricConfig) GetClass() string
GetClass returns the class with fallback to default.
func (*FabricConfig) GetConfirm ¶
func (f *FabricConfig) GetConfirm() bool
GetConfirm returns the confirm flag with fallback to default.
func (*FabricConfig) GetFabricName ¶
func (f *FabricConfig) GetFabricName() string
GetFabricName returns the display name for a fabric (name if set, otherwise url).
func (*FabricConfig) GetOutputFileName ¶
func (f *FabricConfig) GetOutputFileName() string
GetOutputFileName returns the output filename for a fabric.
func (*FabricConfig) GetPageSize ¶
func (f *FabricConfig) GetPageSize() int
GetPageSize returns the page size with fallback to default.
func (*FabricConfig) GetRequestRetryCount ¶
func (f *FabricConfig) GetRequestRetryCount() int
GetRequestRetryCount returns the request retry count with fallback to default.
func (*FabricConfig) GetRetryDelay ¶
func (f *FabricConfig) GetRetryDelay() int
GetRetryDelay returns the retry delay with fallback to default.
func (*FabricConfig) GetSSHPort ¶
func (f *FabricConfig) GetSSHPort() int
GetSSHPort returns the SSH port with fallback to default (22).
func (*FabricConfig) GetVerbose ¶
func (f *FabricConfig) GetVerbose() bool
GetVerbose returns the verbose flag with fallback to default.
func (*FabricConfig) MergeWithGlobal ¶
func (f *FabricConfig) MergeWithGlobal(global GlobalConfig) FabricConfig
MergeWithGlobal applies global settings to a fabric config, with fabric settings taking precedence.
type GlobalConfig ¶
type GlobalConfig struct {
Username string `yaml:"username"`
Password string `yaml:"password"`
RequestRetryCount int `yaml:"request_retry_count"`
RetryDelay int `yaml:"retry_delay"`
BatchSize int `yaml:"batch_size"`
PageSize int `yaml:"page_size"`
Confirm bool `yaml:"confirm"`
Verbose bool `yaml:"verbose"`
Class string `yaml:"class"`
Query map[string]string `yaml:"query"`
SSHPort int `yaml:"ssh_port"`
}
GlobalConfig holds global settings that apply to all fabrics.