config

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: May 11, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

internal/config/config.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(envFilePath string) error

LoadConfig loads configuration from the specified .env file path and environment variables.

Types

type Config

type Config struct {
	APIPort        string        `mapstructure:"API_PORT"`
	JWTSecret      string        `mapstructure:"JWT_SECRET"`
	JWTExpiration  time.Duration `mapstructure:"JWT_EXPIRATION"`  // Renamed for clarity - uses time.Duration directly
	APIUserGroup   string        `mapstructure:"API_USER_GROUP"`  // Group required for basic API login (alternative to clab_admins)
	SuperuserGroup string        `mapstructure:"SUPERUSER_GROUP"` // Group for elevated privileges
	ClabRuntime    string        `mapstructure:"CLAB_RUNTIME"`
	LogLevel       string        `mapstructure:"LOG_LEVEL"`
	TLSEnable      bool          `mapstructure:"TLS_ENABLE"`
	TLSCertFile    string        `mapstructure:"TLS_CERT_FILE"`
	TLSKeyFile     string        `mapstructure:"TLS_KEY_FILE"`
	GinMode        string        `mapstructure:"GIN_MODE"`
	TrustedProxies string        `mapstructure:"TRUSTED_PROXIES"`
	APIServerHost  string        `mapstructure:"API_SERVER_HOST"` // Host/IP/FQDN used for SSH access commands
	SSHBasePort    int           `mapstructure:"SSH_BASE_PORT"`   // Base port for SSH proxy allocation
	SSHMaxPort     int           `mapstructure:"SSH_MAX_PORT"`    // Maximum port for SSH proxy allocation
}
var AppConfig Config

Jump to

Keyboard shortcuts

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