config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Server
	ServerPort     string `mapstructure:"SERVER_PORT"`
	SwaggerEnabled bool   `mapstructure:"SWAGGER_ENABLED"`

	// Dapr
	DaprHost       string `mapstructure:"DAPR_HOST"`
	DaprPort       string `mapstructure:"DAPR_PORT"`
	DBBindingName  string `mapstructure:"DB_BINDING_NAME"` // Dapr binding component name for DB access (server binary)
	DaprMaxRetries int    `mapstructure:"DAPR_MAX_RETRIES"`

	// Logging
	LogLevel  string `mapstructure:"LOG_LEVEL"`
	LogFormat string `mapstructure:"LOG_FORMAT"` // "json" (default) or "console" (colored dev output)

	// Observability
	ServiceName       string  `mapstructure:"APP_NAME"`
	OTelEndpoint      string  `mapstructure:"OTEL_ENDPOINT"`
	OTelSampleRate    float64 `mapstructure:"OTEL_SAMPLE_RATE"` // 0.0–1.0; fraction of root spans sampled
	PyroscopeEndpoint string  `mapstructure:"PYROSCOPE_ENDPOINT"`

	// Timeouts
	LLMTimeoutRaw      string        `mapstructure:"LLM_TIMEOUT"` // e.g. "10s"
	LLMTimeout         time.Duration // parsed from LLMTimeoutRaw in Load()
	ShutdownTimeoutRaw string        `mapstructure:"SHUTDOWN_TIMEOUT"` // e.g. "5s", "10s"
	ShutdownTimeout    time.Duration // parsed from ShutdownTimeoutRaw in Load()
}

func Load

func Load() *Config

Jump to

Keyboard shortcuts

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