Documentation
¶
Overview ¶
Package config loads, validates, and normalizes gateway runtime configuration.
Index ¶
- Constants
- func Validate(cfg Config) error
- type AuthConfig
- type Config
- type GatewayKeyConfig
- type LimitsConfig
- type OTelConfig
- type ObservabilityConfig
- type PIIBodyConfig
- type PIIConfig
- type PIIDetectorsConfig
- type PIIHeadersConfig
- type PIIReplacementConfig
- type PIIScopeConfig
- type PIIScopeInput
- type PIIScopeMatchConfig
- type PIIStagesConfig
- type ProviderConfig
- type ProvidersConfig
- type ServerConfig
- type StorageConfig
- type TracingConfig
- type UsageLimitConfig
Constants ¶
View Source
const ( PIIModeOff = "off" PIIModeRedactStorage = "redact_storage" PIIModeRedactUpstream = "redact_upstream" PIIModeBlock = "block" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthConfig ¶
type AuthConfig struct {
Enabled bool `yaml:"enabled"`
Header string `yaml:"header"`
Keys []GatewayKeyConfig `yaml:"keys"`
}
type Config ¶
type Config struct {
Server ServerConfig `yaml:"server"`
Storage StorageConfig `yaml:"storage"`
Providers ProvidersConfig `yaml:"providers"`
Tracing TracingConfig `yaml:"tracing"`
Observability ObservabilityConfig `yaml:"observability"`
PII PIIConfig `yaml:"pii"`
Auth AuthConfig `yaml:"auth"`
Limits LimitsConfig `yaml:"limits"`
}
func (Config) EffectivePIIMode ¶
func (Config) ResolvePIIPolicy ¶
func (cfg Config) ResolvePIIPolicy(input PIIScopeInput) PIIConfig
type GatewayKeyConfig ¶
type GatewayKeyConfig struct {
ID string `yaml:"id"`
Token string `yaml:"token"`
OrgID string `yaml:"org_id"`
WorkspaceID string `yaml:"workspace_id"`
Team string `yaml:"team"` // Backward-compatible alias for workspace_id.
Name string `yaml:"name"`
Description string `yaml:"description"`
CreatedBy string `yaml:"created_by"`
Role string `yaml:"role"`
Permissions []string `yaml:"permissions"`
}
type LimitsConfig ¶
type LimitsConfig struct {
PerKey UsageLimitConfig `yaml:"per_key"`
PerWorkspace UsageLimitConfig `yaml:"per_workspace"`
}
type OTelConfig ¶
type OTelConfig struct {
Enabled bool `yaml:"enabled"`
Endpoint string `yaml:"endpoint"`
Insecure bool `yaml:"insecure"`
ServiceName string `yaml:"service_name"`
TracesEnabled bool `yaml:"traces_enabled"`
MetricsEnabled bool `yaml:"metrics_enabled"`
PrometheusEnabled bool `yaml:"prometheus_enabled"`
PrometheusPath string `yaml:"prometheus_path"`
SamplingRatio float64 `yaml:"sampling_ratio"`
ExportTimeoutMS int `yaml:"export_timeout_ms"`
MetricExportIntervalMS int `yaml:"metric_export_interval_ms"`
}
type ObservabilityConfig ¶
type ObservabilityConfig struct {
OTel OTelConfig `yaml:"otel"`
}
type PIIBodyConfig ¶
type PIIBodyConfig struct {
KeyDenylist []string `yaml:"key_denylist"`
}
type PIIConfig ¶
type PIIConfig struct {
Mode string `yaml:"mode"`
PolicyID string `yaml:"policy_id"`
Stages PIIStagesConfig `yaml:"stages"`
Detectors PIIDetectorsConfig `yaml:"detectors"`
Headers PIIHeadersConfig `yaml:"headers"`
Body PIIBodyConfig `yaml:"body"`
Replacement PIIReplacementConfig `yaml:"replacement"`
Scopes []PIIScopeConfig `yaml:"scopes"`
}
type PIIDetectorsConfig ¶
type PIIHeadersConfig ¶
type PIIHeadersConfig struct {
Denylist []string `yaml:"denylist"`
}
type PIIReplacementConfig ¶
type PIIScopeConfig ¶
type PIIScopeConfig struct {
Match PIIScopeMatchConfig `yaml:"match"`
Mode string `yaml:"mode"`
PolicyID string `yaml:"policy_id"`
}
type PIIScopeInput ¶
type PIIScopeMatchConfig ¶
type PIIStagesConfig ¶
type ProviderConfig ¶
type ProvidersConfig ¶
type ProvidersConfig struct {
OpenAI ProviderConfig `yaml:"openai"`
Anthropic ProviderConfig `yaml:"anthropic"`
}
type ServerConfig ¶
func (ServerConfig) Address ¶
func (c ServerConfig) Address() string
type StorageConfig ¶
type TracingConfig ¶
type UsageLimitConfig ¶
Click to show internal directories.
Click to hide internal directories.