Initialize work order management system with database schema, API handlers, web client, and Docker configuration.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package config
|
||||
|
||||
import "os"
|
||||
|
||||
type Config struct {
|
||||
Addr string
|
||||
DBDSN string
|
||||
JWTSecret string
|
||||
UploadPath string
|
||||
BaseURL string
|
||||
OIDCIssuer string
|
||||
JWKSUrl string
|
||||
AppEnv string
|
||||
}
|
||||
|
||||
func Load() *Config {
|
||||
return &Config{
|
||||
Addr: env("ADDR", ":8080"),
|
||||
DBDSN: env("DB_DSN", ""),
|
||||
UploadPath: env("UPLOAD_PATH", "./uploads"),
|
||||
BaseURL: env("BASE_URL", "http://localhost:8080"),
|
||||
OIDCIssuer: env("OIDC_ISSUER", "http://localhost:8180/realms/workorders"),
|
||||
JWKSUrl: env("JWKS_URL", "http://localhost:8180/realms/workorders/protocol/openid-connect/certs"),
|
||||
AppEnv: env("APP_ENV", "development"),
|
||||
}
|
||||
}
|
||||
|
||||
func env(key, fallback string) string {
|
||||
if v := os.Getenv(key); v != "" {
|
||||
return v
|
||||
}
|
||||
return fallback
|
||||
}
|
||||
Reference in New Issue
Block a user