35 lines
785 B
Go
35 lines
785 B
Go
// Package config provides service-specific configuration.
|
|
package config
|
|
|
|
import (
|
|
"os"
|
|
"strings"
|
|
|
|
"git.threesix.ai/jordan/slack-final-1770280107/pkg/config"
|
|
)
|
|
|
|
// Config extends the base config with auth-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"),
|
|
}
|
|
}
|