config

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	Username        string `env:"EMERALD_AUTH_USERNAME"`
	Password        string `env:"EMERALD_AUTH_PASSWORD"`
	SessionTTLHours int    `env:"EMERALD_AUTH_SESSION_TTL_HOURS"`
	SessionTTL      time.Duration
	CookieName      string `env:"EMERALD_AUTH_COOKIE_NAME"`
}

func (AuthConfig) Validate added in v1.11.1

func (c AuthConfig) Validate() error

type Config

type Config struct {
	Server   ServerConfig
	Database DatabaseConfig
	Auth     AuthConfig
	Security SecurityConfig
}

func Load

func Load() (*Config, error)

func (*Config) Validate

func (c *Config) Validate() error

type DatabaseConfig

type DatabaseConfig struct {
	Path string `env:"EMERALD_DB_PATH"`
}

func (DatabaseConfig) Validate added in v1.11.1

func (c DatabaseConfig) Validate() error

type SecurityConfig added in v1.11.1

type SecurityConfig struct {
	EncryptionKey          string   `env:"EMERALD_ENCRYPTION_KEY"`
	AllowDBStoredKey       bool     `env:"EMERALD_ALLOW_DB_STORED_KEY"`
	AllowedOrigins         []string `env:"EMERALD_ALLOWED_ORIGINS" env-separator:","`
	TrustProxy             bool     `env:"EMERALD_TRUST_PROXY"`
	TrustedProxies         []string `env:"EMERALD_TRUSTED_PROXIES" env-separator:","`
	AllowPrivateWebTools   bool     `env:"EMERALD_ALLOW_PRIVATE_WEBTOOLS"`
	AllowAbsoluteToolPaths bool     `env:"EMERALD_ALLOW_ABSOLUTE_TOOL_PATHS"`
	AllowPlugins           bool     `env:"EMERALD_ALLOW_PLUGINS"`
}

func (SecurityConfig) Validate added in v1.11.1

func (c SecurityConfig) Validate() error

type ServerConfig

type ServerConfig struct {
	Port string `env:"EMERALD_PORT"`
	Host string `env:"EMERALD_HOST"`
}

func (ServerConfig) Validate added in v1.11.1

func (c ServerConfig) Validate() error

Jump to

Keyboard shortcuts

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