Documentation
¶
Overview ¶
Package config loads configuration from environment variables.
Index ¶
- Constants
- func DBLessDataPlaneEnabled() bool
- type CORSConfig
- type CacheConfig
- type CatalogConfig
- type Config
- type ConfigSyncConfig
- type DatabaseConfig
- type KafkaConfig
- type LoggerConfig
- type MetricsConfig
- type OTLPConfig
- type OpenAIModerationConfig
- type PlaygroundConfig
- type ProviderConfig
- type RedisConfig
- type SemanticCacheConfig
- type ServerConfig
- type SessionStoreConfig
- type TelemetryConfig
- type TrustGuardConfig
- type UpstreamConfig
Constants ¶
const ( GatewayDiscoveryModeHeader = "header" GatewayDiscoveryModeSubdomain = "subdomain" )
const ( ConfigSyncAuthModeSigned = "signed" // ConfigSyncAuthModeComposite accepts both a signed per-tenant JWT (external // data planes → scoped snapshot) and the shared bearer token (in-cluster data // plane → global snapshot) on a single control plane. ConfigSyncAuthModeComposite = "composite" )
Variables ¶
This section is empty.
Functions ¶
func DBLessDataPlaneEnabled ¶ added in v0.3.4
func DBLessDataPlaneEnabled() bool
Types ¶
type CORSConfig ¶
type CORSConfig struct {
AllowOrigins []string
AllowMethods []string
AllowHeaders []string
ExposeHeaders []string
AllowCredentials bool
MaxAge string
}
CORSConfig drives the CORSMiddleware applied by both admin and proxy. Lists are comma-separated in env. Use "*" in AllowOrigins to allow any.
type CacheConfig ¶
CacheConfig drives the in-process TTL cache used by app-layer finders. RUN-291 (B.1) will add a parallel Redis-backed layer; the finder contract will not change.
type CatalogConfig ¶
type CatalogConfig struct {
ModelsDevBaseURL string
}
type Config ¶
type Config struct {
AppEnv string
Server ServerConfig
Database DatabaseConfig
Redis RedisConfig
Cache CacheConfig
SemanticCache SemanticCacheConfig
SessionStore SessionStoreConfig
Kafka KafkaConfig
Telemetry TelemetryConfig
Metrics MetricsConfig
Playground PlaygroundConfig
Upstream UpstreamConfig
Provider ProviderConfig
Catalog CatalogConfig
CORS CORSConfig
Logger LoggerConfig
TrustGuard TrustGuardConfig
OpenAIModeration OpenAIModerationConfig
ConfigSync ConfigSyncConfig
}
func LoadConfig ¶
func (*Config) IsDeployed ¶ added in v0.3.4
IsDeployed reports whether APP_ENV marks a non-local deployment (staging or production), so plane wiring can enforce deployed-only requirements such as the control-plane config-sync gRPC server TLS certificate.
type ConfigSyncConfig ¶ added in v0.3.4
type ConfigSyncConfig struct {
DataPlaneEnabled bool
Token string // #nosec G117 -- config struct field, not a hardcoded credential
// TokenPrevious is the prior bearer accepted alongside Token so a token can be
// rotated without a window where in-flight data planes fail to authenticate.
TokenPrevious string // #nosec G117 -- config struct field, not a hardcoded credential
AuthMode string
JWTPublicKey string // #nosec G117 -- config struct field, not a hardcoded credential
JWTJWKSURL string
JWTIssuer string
JWTAudience string
LKGPath string
LKGKey string // #nosec G117 -- config struct field, not a hardcoded credential
PollInterval time.Duration
RecompileDebounce time.Duration
// RecompileBackstop periodically recompiles even without a write signal so the
// control plane recovers from a failed boot compile and picks up out-of-band
// mutations.
RecompileBackstop time.Duration
InstanceID string
// GRPCEndpoint is the control-plane host:port the data plane dials for the
// config-sync gRPC transport (ENG-959).
GRPCEndpoint string
// GRPCListenAddr is the control-plane listen address for the config-sync gRPC
// server.
GRPCListenAddr string
TLSCAPath string
TLSServerName string
// TLSInsecure disables transport security on the data-plane dial. It is a
// dev-only escape hatch and is rejected in deployed environments.
TLSInsecure bool
GRPCTLSCertPath string
GRPCTLSKeyPath string // #nosec G117 -- config struct field, not a hardcoded credential
GRPCKeepaliveTime time.Duration
GRPCKeepaliveTimeout time.Duration
GRPCMinBackoff time.Duration
GRPCMaxBackoff time.Duration
OutboxRetention time.Duration
OutboxMaxRows int64
}
func (ConfigSyncConfig) Validate ¶ added in v0.3.4
func (cs ConfigSyncConfig) Validate() error
type DatabaseConfig ¶
type DatabaseConfig struct {
Host string
Port int
User string
Password string // #nosec G117 -- config struct field, not a hardcoded credential
Name string
SSLMode string
SSLRootCert string
MinConns int32
MaxConns int32
MaxConnLifetime time.Duration
MaxConnIdleTime time.Duration
HealthCheckPeriod time.Duration
ConnectTimeout time.Duration
}
type KafkaConfig ¶
type KafkaConfig struct {
Brokers []string
}
type MetricsConfig ¶
type OTLPConfig ¶
type OTLPConfig struct {
Endpoint string
Headers map[string]string
Protocol string
Timeout time.Duration
Insecure bool
Compression string
}
OTLPConfig holds process-level OTLP exporter defaults read from the standard OTEL_EXPORTER_OTLP_* environment variables. Per-gateway telemetry settings override any field present in the gateway configuration.
type OpenAIModerationConfig ¶ added in v0.2.4
type PlaygroundConfig ¶
PlaygroundConfig drives the default Redis-backed trace store that lets the dashboard playground fetch the metrics Event for a request it just made. Only requests carrying the playground token are stored, with a short TTL.
type ProviderConfig ¶
type RedisConfig ¶
type SemanticCacheConfig ¶ added in v0.3.4
type SemanticCacheConfig struct {
VectorStore string
}
SemanticCacheConfig selects the vector store backing the semantic cache plugin. VectorStore defaults to "redis".
type ServerConfig ¶
type ServerConfig struct {
AdminPort int
ProxyPort int
MCPPort int
ReadTimeout time.Duration
WriteTimeout time.Duration
IdleTimeout time.Duration
// SecretKey signs and verifies admin-plane JWTs. Empty disables admin auth
// token acceptance (every token is rejected).
SecretKey string
GatewayBaseDomain string
MCPBaseDomain string
GatewayDiscoveryMode string
STSIssuer string
STSSigningKey string
TrustXFCCFrom []string
}