sp3-verify-1770325830/services/chat-api/internal/config/config.go
rdev-worker 42c1444274
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
build: /implement-feature websocket-chat --requirements 'GET /ws upgrades to...
2026-02-05 21:50:17 +00:00

39 lines
886 B
Go

// Package config provides service-specific configuration.
package config
import (
"os"
"strings"
"git.threesix.ai/jordan/sp3-verify-1770325830/pkg/config"
)
// Config extends the base config with chat-api-specific settings.
type Config struct {
config.AppConfig
Server config.ServerConfig
Database config.DatabaseConfig
Logging config.LoggingConfig
// Auth
AuthEnabled bool
JWTSecret string
// Redis configuration for realtime pub/sub
RedisURL 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"),
RedisURL: os.Getenv("REDIS_URL"),
}
}