config

package
v0.0.0-...-373e6db Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActiveHealthCheckConfig

type ActiveHealthCheckConfig struct {
	Enabled  bool   `yaml:"enabled"`
	Interval int    `yaml:"interval"`
	Timeout  int    `yaml:"timeout"`
	Path     string `yaml:"path"`
}

ActiveHealthCheckConfig holds the active health check configuration

type AdminAPIConfig

type AdminAPIConfig struct {
	Enabled     bool     `yaml:"enabled"`
	Port        int      `yaml:"port"`
	AuthToken   string   `yaml:"auth_token,omitempty"`
	IPAllowList []string `yaml:"ip_allow_list,omitempty"`
	IPDenyList  []string `yaml:"ip_deny_list,omitempty"`
}

AdminAPIConfig holds the Admin API configuration

type BackendConfig

type BackendConfig struct {
	Name    string `yaml:"name"`
	Address string `yaml:"address"`
	Weight  int    `yaml:"weight,omitempty"`
}

BackendConfig holds the backend server configuration

type CircuitBreakerConfig

type CircuitBreakerConfig struct {
	Enabled          bool `yaml:"enabled"`
	MaxRequests      int  `yaml:"max_requests"`
	IntervalSeconds  int  `yaml:"interval_seconds"`
	TimeoutSeconds   int  `yaml:"timeout_seconds"`
	FailureThreshold int  `yaml:"failure_threshold"`
	SuccessThreshold int  `yaml:"success_threshold"`
}

CircuitBreakerConfig holds the circuit breaker configuration

type Config

type Config struct {
	Server         ServerConfig         `yaml:"server"`
	Backends       []BackendConfig      `yaml:"backends"`
	LoadBalancer   LoadBalancerConfig   `yaml:"load_balancer"`
	HealthChecks   HealthChecksConfig   `yaml:"health_checks"`
	RateLimit      RateLimitConfig      `yaml:"rate_limit"`
	CircuitBreaker CircuitBreakerConfig `yaml:"circuit_breaker"`
	Metrics        MetricsConfig        `yaml:"metrics"`
	AdminAPI       AdminAPIConfig       `yaml:"admin_api"`
	Plugins        PluginsConfig        `yaml:"plugins"`
	Logging        LoggingConfig        `yaml:"logging"`
}

Config represents the main configuration structure for Helios

func LoadConfig

func LoadConfig(filePath string) (*Config, error)

LoadConfig loads configuration from the specified YAML file

func (*Config) Validate

func (c *Config) Validate() error

Validate performs comprehensive validation of the configuration

type HealthChecksConfig

type HealthChecksConfig struct {
	Active  ActiveHealthCheckConfig  `yaml:"active"`
	Passive PassiveHealthCheckConfig `yaml:"passive"`
}

HealthChecksConfig holds the health check configuration

type LoadBalancerConfig

type LoadBalancerConfig struct {
	Strategy      string              `yaml:"strategy"`
	WebSocketPool WebSocketPoolConfig `yaml:"websocket_pool"`
}

LoadBalancerConfig holds the load balancer configuration

type LoggingConfig

type LoggingConfig struct {
	Level         string          `yaml:"level"`
	Format        string          `yaml:"format"`
	IncludeCaller bool            `yaml:"include_caller"`
	RequestID     RequestIDConfig `yaml:"request_id"`
	Trace         TraceConfig     `yaml:"trace"`
}

LoggingConfig holds the structured logging configuration

type MetricsConfig

type MetricsConfig struct {
	Enabled bool   `yaml:"enabled"`
	Port    int    `yaml:"port"`
	Path    string `yaml:"path"`
}

MetricsConfig holds the metrics configuration

type PassiveHealthCheckConfig

type PassiveHealthCheckConfig struct {
	Enabled            bool `yaml:"enabled"`
	UnhealthyThreshold int  `yaml:"unhealthy_threshold"`
	UnhealthyTimeout   int  `yaml:"unhealthy_timeout"`
}

PassiveHealthCheckConfig holds the passive health check configuration

type PluginConfig

type PluginConfig struct {
	Name   string                 `yaml:"name"`
	Config map[string]interface{} `yaml:"config,omitempty"`
}

PluginConfig represents a single plugin in the chain

type PluginsConfig

type PluginsConfig struct {
	Enabled bool           `yaml:"enabled"`
	Chain   []PluginConfig `yaml:"chain"`
}

PluginsConfig holds plugin system configuration

type RateLimitConfig

type RateLimitConfig struct {
	Enabled    bool `yaml:"enabled"`
	MaxTokens  int  `yaml:"max_tokens"`
	RefillRate int  `yaml:"refill_rate_seconds"`
}

RateLimitConfig holds the rate limiting configuration

type RequestIDConfig

type RequestIDConfig struct {
	Enabled bool   `yaml:"enabled"`
	Header  string `yaml:"header"`
}

RequestIDConfig controls request identifier generation and propagation

type ServerConfig

type ServerConfig struct {
	Port     int           `yaml:"port"`
	TLS      TLSConfig     `yaml:"tls,omitempty"`
	Timeouts TimeoutConfig `yaml:"timeouts,omitempty"`
}

ServerConfig holds the server configuration

type TLSConfig

type TLSConfig struct {
	Enabled  bool   `yaml:"enabled"`
	CertFile string `yaml:"certFile"`
	KeyFile  string `yaml:"keyFile"`
}

TLSConfig holds the TLS configuration settings

type TimeoutConfig

type TimeoutConfig struct {
	Read        int `yaml:"read"`         // ReadTimeout in seconds
	Write       int `yaml:"write"`        // WriteTimeout in seconds
	Idle        int `yaml:"idle"`         // IdleTimeout in seconds
	Handler     int `yaml:"handler"`      // Handler timeout in seconds (end-to-end request)
	Shutdown    int `yaml:"shutdown"`     // Graceful shutdown timeout in seconds
	BackendDial int `yaml:"backend_dial"` // Backend connection dial timeout in seconds
	BackendRead int `yaml:"backend_read"` // Backend response read timeout in seconds
	BackendIdle int `yaml:"backend_idle"` // Backend idle connection timeout in seconds
}

TimeoutConfig holds HTTP server timeout settings

type TraceConfig

type TraceConfig struct {
	Enabled bool   `yaml:"enabled"`
	Header  string `yaml:"header"`
}

TraceConfig controls distributed trace propagation

type WebSocketPoolConfig

type WebSocketPoolConfig struct {
	Enabled            bool `yaml:"enabled"`
	MaxIdle            int  `yaml:"max_idle"`
	MaxActive          int  `yaml:"max_active"`
	IdleTimeoutSeconds int  `yaml:"idle_timeout_seconds"`
}

WebSocketPoolConfig holds WebSocket connection pool settings

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL