config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIConfig

type APIConfig struct {
	Host string `mapstructure:"host"`
	Port int    `mapstructure:"port"`

	// Timeouts
	ReadTimeoutSec    int64 `mapstructure:"read_timeout_sec"`
	WriteTimeoutSec   int64 `mapstructure:"write_timeout_sec"`
	IdleTimeoutSec    int64 `mapstructure:"idle_timeout_sec"`
	WSReadTimeoutSec  int64 `mapstructure:"ws_read_timeout_sec"`
	WSWriteTimeoutSec int64 `mapstructure:"ws_write_timeout_sec"`
	WSReadLimitBytes  int64 `mapstructure:"ws_read_limit_bytes"`

	// Default max inflights per consumer
	DefaultMaxInflights int `mapstructure:"default_max_inflights"`

	// Path to auth.yml file
	AuthPath string `mapstructure:"auth_path"`

	// TLS settings for API (HTTP/WebSocket)
	TLSEnabled bool   `mapstructure:"tls_enabled"`
	CertPath   string `mapstructure:"cert_path"`
	KeyPath    string `mapstructure:"key_path"`
}

type ClusterConfig

type ClusterConfig struct {
	// QUIC server (this proxy listens on)
	QUICAddr string `mapstructure:"quic_addr"`
	QUICPort int    `mapstructure:"quic_port"`

	// TLS settings for Cluster (QUIC)
	CertPath string `mapstructure:"cert_path"`
	KeyPath  string `mapstructure:"key_path"`
	CAPath   string `mapstructure:"ca_path"`

	DiscoveryKind     string `mapstructure:"discovery_kind"`
	DiscoveryYMLPath  string `mapstructure:"discovery_yml_path"`  // Required for DiscoveryKindStatic
	DiscoveryHTTPHost string `mapstructure:"discovery_http_host"` // Required for DiscoveryKindHttp

}

type Config

type Config struct {
	// Proxy identification
	ProxyID string `mapstructure:"-"`

	// API Server
	API APIConfig `mapstructure:"api"`

	// Cluster Agent
	Cluster ClusterConfig `mapstructure:"cluster"`
}

func DefaultConfig

func DefaultConfig() *Config

Default values

func LoadConfig

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

LoadConfig loads configuration from file and binds CLI flags

func (*Config) GetAPIAddress

func (c *Config) GetAPIAddress() string

GetAPIAddress returns the full API server address

func (*Config) GetQUICAddress

func (c *Config) GetQUICAddress() string

GetQUICAddress returns the full QUIC server address

func (*Config) Validate

func (c *Config) Validate() error

Validate returns all validation errors

type DiscoveryKind added in v0.3.0

type DiscoveryKind uint8
const (
	DiscoveryKindStatic DiscoveryKind = iota
	DiscoveryKindHttp
)

func ParseDiscoveryKind added in v0.3.0

func ParseDiscoveryKind(s string) (DiscoveryKind, error)

ParseDiscoveryKind converts a string to DiscoveryKind

func (DiscoveryKind) String added in v0.3.0

func (d DiscoveryKind) String() string

String returns the string representation of DiscoveryKind

Jump to

Keyboard shortcuts

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