config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 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"`
	JWTExpirationMinutes time.Duration `mapstructure:"JWT_EXPIRATION_MINUTES"`
	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"`
}
var AppConfig Config

Jump to

Keyboard shortcuts

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