config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnv

func GetEnv(key, 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
}

Config represents the application configuration

func ParseConfig

func ParseConfig() (*Config, error)

ParseConfig parses command-line flags and environment variables

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration

Jump to

Keyboard shortcuts

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