slate-test-1770507751/services/preferences-api/internal/config/config.go
jordan e535b10bfc
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Add service component: preferences-api
2026-02-07 23:42:39 +00:00

35 lines
791 B
Go

// Package config provides service-specific configuration.
package config
import (
"os"
"strings"
"git.threesix.ai/jordan/slate-test-1770507751/pkg/config"
)
// Config extends the base config with preferences-api-specific settings.
type Config struct {
config.AppConfig
Server config.ServerConfig
Database config.DatabaseConfig
Logging config.LoggingConfig
// Auth
AuthEnabled bool
JWTSecret string
}
// Load reads configuration from environment variables.
func Load() *Config {
return &Config{
AppConfig: config.ReadAppConfig(),
Server: config.ReadServerConfig(),
Database: config.ReadDatabaseConfig(),
Logging: config.ReadLoggingConfig(),
AuthEnabled: strings.EqualFold(os.Getenv("AUTH_ENABLED"), "true"),
JWTSecret: os.Getenv("JWT_SECRET"),
}
}