feat: initialize managed portal
This commit is contained in:
29
internal/config/config.go
Normal file
29
internal/config/config.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package config
|
||||
|
||||
import "os"
|
||||
|
||||
type Config struct {
|
||||
HTTPAddr string
|
||||
WebDistDir string
|
||||
RegistryPath string
|
||||
}
|
||||
|
||||
func Load() *Config {
|
||||
cfg := &Config{
|
||||
HTTPAddr: ":8080",
|
||||
WebDistDir: "web/dist",
|
||||
RegistryPath: "managed_services.yaml",
|
||||
}
|
||||
|
||||
if value := os.Getenv("MANAGED_PORTAL_HTTP_ADDR"); value != "" {
|
||||
cfg.HTTPAddr = value
|
||||
}
|
||||
if value := os.Getenv("MANAGED_PORTAL_WEB_DIST_DIR"); value != "" {
|
||||
cfg.WebDistDir = value
|
||||
}
|
||||
if value := os.Getenv("MANAGED_PORTAL_REGISTRY_PATH"); value != "" {
|
||||
cfg.RegistryPath = value
|
||||
}
|
||||
|
||||
return cfg
|
||||
}
|
||||
Reference in New Issue
Block a user