config

package
v0.2.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnvIntWithDefault

func GetEnvIntWithDefault(key string, defaultValue int) int

GetEnvIntWithDefault returns an environment variable as int or a default

func GetEnvWithDefault

func GetEnvWithDefault(key, defaultValue string) string

GetEnvWithDefault returns an environment variable value or a default

Types

type Config

type Config struct {
	// Server settings
	Port     int      `json:"port"`
	AdminKey string   `json:"admin_key"`
	Admins   []string `json:"admins"`

	// Database settings
	DBPath string `json:"db_path"`

	// Logging
	LogLevel string `json:"log_level"`

	// JWT settings
	JWTSecret string `json:"jwt_secret"`

	// Config directory
	ConfigDir string `json:"config_dir"`
}

Config holds all application configuration

func LoadConfig

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

LoadConfig loads configuration from environment variables, .env files, and config files

Jump to

Keyboard shortcuts

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