Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindConfigFiles ¶
FindConfigFiles returns a list of config.yaml paths in precedence order. Returns: [exeDir/config.yaml, platformDir/config.yaml] This is exported for use by Config.LoadFromYAML().
Types ¶
type Opt ¶
type Opt struct {
Port OptInt // TCP port the HTTP server binds to
RunFileDiscovery OptBool // Whether to run discovery on startup
DebugDelayMS OptInt // Optional artificial delay for debug/testing
Profile OptString // Profiling mode: "", "cpu", "mem", "block", etc.
EnableCompression OptBool // Enable gzip/brotli compression
EnableHTTPCache OptBool // Enable SQLite HTTP response caching
EnableCachePreload OptBool // Enable cache preloading when folders are opened
SessionSecret OptString // Secret key for session cookie signing (required)
SessionSecure OptBool // Restrict session cookies to HTTPS
SessionHttpOnly OptBool // Set HttpOnly flag on session cookies
SessionMaxAge OptInt // Max age for session cookies in seconds
SessionSameSite OptString // SameSite policy for session cookies (Strict, Lax, None)
UnlockAccount OptString // Username to unlock (empty string if not set)
RestoreLastKnownGood OptBool // Restore last known good configuration from database on startup
IncrementETag OptBool // Increment application-wide ETag version on startup
}
Package getopt parses runtime configuration from environment variables and command-line flags. Precedence: CLI flags > Environment variables. Opt holds all runtime options parsed from env and CLI flags. All fields use nullable types to track whether they were explicitly set.
func Parse ¶
func Parse() Opt
Parse reads configuration from environment variables and CLI flags. Precedence: CLI flags > Environment variables. YAML config files are NOT handled here - they are handled by Config.LoadFromYAML().
func ParseEnvOnly ¶
func ParseEnvOnly() Opt
ParseEnvOnly reads configuration from environment variables only (no CLI flags). Used by tests to parse env vars set with t.Setenv() without interfering with test flags.