config

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateCompletion added in v0.2.0

func GenerateCompletion(shellType string) error

GenerateCompletion generates shell completion scripts

func GetBoolEnv added in v0.2.0

func GetBoolEnv(key string, fallback bool) bool

GetBoolEnv gets a boolean environment variable or returns a default value

func GetEnv

func GetEnv(key string, fallback string) string

Helper functions to get values from environment variables GetEnv gets an environment variable or returns a default value

func GetEnvDuration

func GetEnvDuration(key string, fallback time.Duration) time.Duration

GetEnvDuration gets a duration environment variable or returns a default value

func GetEnvInt

func GetEnvInt(key string, fallback int) int

GetEnvInt gets an integer environment variable or returns a default value

func LoadEnvFileForTesting

func LoadEnvFileForTesting()

LoadEnvFileForTesting exports the loadEnvFile function for testing purposes

Types

type Config

type Config struct {
	// Essential settings
	Username   string
	Password   string
	Repository string
	Namespace  string
	Content    string
	MaxContent int
	OutputPath string

	// Performance settings
	Concurrency int
	Timeout     time.Duration
	RetryCount  int
	RetryDelay  time.Duration

	// Advanced settings
	LogLevel       string
	LogFile        string
	ShowVersion    bool
	Force          bool
	DryRun         bool
	Profile        string
	ConfigFilePath string
	Version        string

	// Telemetry settings
	TelemetryEnabled bool
	MetricsEnabled   bool
}

Config represents the application configuration

func DefaultConfig added in v0.2.0

func DefaultConfig() *Config

DefaultConfig returns a config with sensible defaults

func ParseConfig

func ParseConfig() (*Config, error)

ParseConfig parses command-line flags, environment variables, and config files

func (*Config) LoadFromFile added in v0.2.0

func (c *Config) LoadFromFile(filePath string) error

LoadFromFile loads configuration from a file

func (*Config) SaveToFile added in v0.2.0

func (c *Config) SaveToFile(filePath string) error

SaveToFile saves configuration to a file

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration

type ConfigProfile added in v0.2.0

type ConfigProfile struct {
	Name        string
	Description string
	Settings    map[string]interface{}
}

ConfigProfile represents a named set of configuration options

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL