Documentation
¶
Overview ¶
Package config loads configuration from environment variables.
Index ¶
- Constants
- type CORSConfig
- type CacheConfig
- type CatalogConfig
- type Config
- type DatabaseConfig
- type KafkaConfig
- type LoggerConfig
- type MetricsConfig
- type OTLPConfig
- type OpenAIModerationConfig
- type PlaygroundConfig
- type ProviderConfig
- type RedisConfig
- type ServerConfig
- type SessionStoreConfig
- type TelemetryConfig
- type TrustGuardConfig
- type UpstreamConfig
Constants ¶
const ( GatewayDiscoveryModeHeader = "header" GatewayDiscoveryModeSubdomain = "subdomain" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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
SessionStore SessionStoreConfig
Kafka KafkaConfig
Telemetry TelemetryConfig
Metrics MetricsConfig
Playground PlaygroundConfig
Upstream UpstreamConfig
Provider ProviderConfig
Catalog CatalogConfig
CORS CORSConfig
Logger LoggerConfig
TrustGuard TrustGuardConfig
OpenAIModeration OpenAIModerationConfig
}
func LoadConfig ¶
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 LoggerConfig ¶
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 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
}
type SessionStoreConfig ¶
type TelemetryConfig ¶
type TelemetryConfig struct {
Enabled bool
KafkaTopic string
EnableRequestTraces bool
EnablePluginTraces bool
OTLP OTLPConfig
}