feat: enhance evobgp with new command-line tools for bundle management, including pull, verify, and apply functionalities. Update go.mod to include necessary dependencies and complete todos in architecture plan for improved observability and deployment practices.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
// Package config loads control-plane settings from the environment (see architecture plan §1).
|
||||
package config
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Env holds shared process configuration for cmd/* entrypoints.
|
||||
type Env struct {
|
||||
HTTPAddr string
|
||||
ServiceName string
|
||||
GitSHA string
|
||||
// DatabaseURL is the PostgreSQL DSN when SQL-backed repositories are wired (empty in dev).
|
||||
DatabaseURL string
|
||||
// BrokerURL is NATS/Redis when the reference profile uses a message broker (empty in microVPS).
|
||||
BrokerURL string
|
||||
}
|
||||
|
||||
// Load reads EVOBGP_* environment variables with safe defaults.
|
||||
func Load() Env {
|
||||
e := Env{
|
||||
HTTPAddr: ":8080",
|
||||
}
|
||||
if v := strings.TrimSpace(os.Getenv("EVOBGP_HTTP_ADDR")); v != "" {
|
||||
e.HTTPAddr = v
|
||||
}
|
||||
if v := strings.TrimSpace(os.Getenv("EVOBGP_SERVICE")); v != "" {
|
||||
e.ServiceName = v
|
||||
}
|
||||
e.GitSHA = strings.TrimSpace(os.Getenv("EVOBGP_GIT_SHA"))
|
||||
e.DatabaseURL = strings.TrimSpace(os.Getenv("EVOBGP_DATABASE_URL"))
|
||||
e.BrokerURL = strings.TrimSpace(os.Getenv("EVOBGP_BROKER_URL"))
|
||||
return e
|
||||
}
|
||||
Reference in New Issue
Block a user