cmd

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package cmd provides command-line argument parsing and configuration management functionality. Supports loading configuration from command-line arguments, environment variables and configuration files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateConfig

func ValidateConfig(cfg *Config) error

ValidateConfig validates configuration validity

Types

type Config

type Config struct {
	Port             string // 16 bytes
	Redis            string // 16 bytes
	RedisPassword    string // 16 bytes
	RedisEnabled     bool   // 1 byte (padding to 8 bytes)
	RemoteConfig     string // 16 bytes
	RemoteKey        string // 16 bytes
	Mode             string // 16 bytes
	APIKey           string // 16 bytes
	TaskInterval     int    // 8 bytes
	HTTPTimeout      int    // 8 bytes
	HTTPMaxIdleConns int    // 8 bytes
	HTTPInsecureTLS  bool   // 1 byte (padding to 8 bytes)
}

Config stores application configuration

func GetArgs

func GetArgs() *Config

GetArgs parses command-line arguments and environment variables, returns configuration struct Priority: command-line arguments > environment variables > configuration file > default values If -config-file parameter is provided, will attempt to load from configuration file

func LoadConfig

func LoadConfig(configFile string) (*Config, error)

LoadConfig loads configuration (new interface, supports configuration file) Priority: command-line arguments > environment variables > configuration file > default values

Jump to

Keyboard shortcuts

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