refactor(config): centralize env loading and enforce typed access
- Centralize environment variable loading in config.MustLoad - Parse and validate all env vars once at initialization - Make config fields private and read-only - Remove public Getenv usage in favor of typed accessors - Improve validation and initialization order - Normalize enum naming to be idiomatic and avoid constant collisions
This commit is contained in:
@@ -12,9 +12,9 @@ type httpServer struct {
|
||||
port string
|
||||
}
|
||||
|
||||
func NewHTTPServer(port string, sessionRegistry registry.Registry, redirectTLS bool) Transport {
|
||||
func NewHTTPServer(domain, port string, sessionRegistry registry.Registry, redirectTLS bool) Transport {
|
||||
return &httpServer{
|
||||
handler: newHTTPHandler(sessionRegistry, redirectTLS),
|
||||
handler: newHTTPHandler(domain, sessionRegistry, redirectTLS),
|
||||
port: port,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user