Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthConfig ¶
type AuthConfig struct {
Mode string `yaml:"mode"` // "hmac" | "jwks"
HMACSecret string `yaml:"hmac_secret"` // shared secret for HS256 (hmac mode)
JWKS JWKSAuthConfig `yaml:"jwks"` // jwks mode settings
}
type Config ¶
type Config struct {
Server ServerConfig `yaml:"server"`
Upstream UpstreamConfig `yaml:"upstream"`
Auth AuthConfig `yaml:"auth"`
RateLimit RateLimitBackend `yaml:"rate_limit"`
Routes []RouteConfig `yaml:"routes"`
}
type JWKSAuthConfig ¶
type MatchConfig ¶
type MatchConfig struct {
PathPrefix string `yaml:"path_prefix"`
}
type MemoryRLConfig ¶
type RateLimitBackend ¶
type RateLimitBackend struct {
Backend string `yaml:"backend"` // "redis" | "memory"
Redis RedisConfig `yaml:"redis"`
Memory MemoryRLConfig `yaml:"memory"`
}
type RedisConfig ¶
type RouteCircuitBreaker ¶
type RouteConcurrency ¶
type RouteConcurrency struct {
MaxInFlight int `yaml:"max_in_flight"`
}
type RouteConfig ¶
type RouteConfig struct {
Name string `yaml:"name"`
Match MatchConfig `yaml:"match"`
Upstream string `yaml:"upstream"`
StripPrefix string `yaml:"strip_prefix"`
AuthRequired bool `yaml:"auth_required"`
RateLimit RouteRLConfig `yaml:"rate_limit"`
Concurrency RouteConcurrency `yaml:"concurrency"`
CircuitBreaker RouteCircuitBreaker `yaml:"circuit_breaker"`
}
type RouteRLConfig ¶
type ServerConfig ¶
type ServerConfig struct {
Addr string `yaml:"addr"`
TrustedProxies []string `yaml:"trusted_proxies"`
MaxHeaderBytes int `yaml:"max_header_bytes"`
MaxBodyBytes int64 `yaml:"max_body_bytes"`
ReadTimeoutSeconds int `yaml:"read_timeout_seconds"`
WriteTimeoutSeconds int `yaml:"write_timeout_seconds"`
IdleTimeoutSeconds int `yaml:"idle_timeout_seconds"`
ReadHeaderTimeoutSeconds int `yaml:"read_header_timeout_seconds"`
}
type UpstreamConfig ¶
type UpstreamConfig struct {
DialTimeoutSeconds int `yaml:"dial_timeout_seconds"`
TLSHandshakeTimeoutSeconds int `yaml:"tls_handshake_timeout_seconds"`
ResponseHeaderTimeoutSeconds int `yaml:"response_header_timeout_seconds"`
IdleConnTimeoutSeconds int `yaml:"idle_conn_timeout_seconds"`
MaxIdleConns int `yaml:"max_idle_conns"`
MaxIdleConnsPerHost int `yaml:"max_idle_conns_per_host"`
}
Click to show internal directories.
Click to hide internal directories.