← All Go packages

github.com/anulum/director-ai/gateway/internal/config

package config // import "github.com/anulum/director-ai/gateway/internal/config"

Package config resolves gateway settings from the environment. Kept deliberately
flat: each field has one env var, one flag override, and an explicit default.
No YAML, no TOML, no struct tags.

TYPES

type Config struct {
	ListenAddr        string
	UpstreamURL       string
	UpstreamTimeout   time.Duration
	APIKeys           []string
	AuditSalt         []byte
	AuditLogPath      string
	RateLimitRPM      int
	RateLimitBurst    int
	AllowHTTPUpstream bool
	ScoringAddr       string
	ScoringTimeout    time.Duration
	RiskEnabled       bool
	RiskAllowance     float64
	RiskWindowSeconds float64
}
    Config is the fully resolved gateway configuration.

func Load() (*Config, error)
    Load reads the configuration from environment variables and returns an
    error if anything is malformed. Unset values fall back to safe defaults;
    empty "DIRECTOR_API_KEYS" means "no auth" (dev mode only) and is accepted
    but logged by the caller.