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.
CI / changes (push) Successful in 4s
CI / go (push) Failing after 6s
CI / bird2 (push) Has been skipped
CI / openapi (push) Has been skipped

This commit is contained in:
Denozordec
2026-04-05 14:07:45 +07:00
parent 272542b92a
commit bf52b21150
131 changed files with 9222 additions and 17 deletions
+35
View File
@@ -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
}