Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentAddress ¶
type AgentCacheConfig ¶
type AgentCacheConfig struct {
TokenCapacity int `mapstructure:"token_capacity"`
UserCapacity int `mapstructure:"user_capacity"`
UserRoutingsCapacity int `mapstructure:"user_routings_capacity"`
PrivateChannelsCapacity int `mapstructure:"private_channels_capacity"`
NegativeTTLSeconds int `mapstructure:"negative_ttl_seconds"`
}
AgentCacheConfig 控制 agent 端 LRU 缓存的容量与负缓存 TTL。
type AgentConfig ¶
type AgentConfig struct {
Listen string `mapstructure:"listen"` // ":8139" | "unix:/run/gw.sock" | "unix:@name"(abstract, Linux)
MasterURL string `mapstructure:"master_url"` // "http://host:port" | "unix:/run/gw.sock"(same-host UDS)
EnrollmentToken string `mapstructure:"enrollment_token"`
CredentialsFile string `mapstructure:"credentials_file"`
FullSyncInterval int `mapstructure:"full_sync_interval"`
ReportBufferSize int `mapstructure:"report_buffer_size"`
ReportFlushInterval int `mapstructure:"report_flush_interval"`
HeartbeatInterval int `mapstructure:"heartbeat_interval"`
HTTPAddresses []AgentAddress `mapstructure:"http_addresses"`
Tags string `mapstructure:"tags"`
ProxyURL string `mapstructure:"proxy_url"`
PreferredAddrTag string `mapstructure:"preferred_address_tag"`
Cache AgentCacheConfig `mapstructure:"cache"`
}
type AgentRuntimeConfig ¶
type AgentRuntimeConfig struct {
LogLevel string
Agent AgentConfig
Runtime RuntimeConfig
Relay RelayConfig
Metrics MetricsConfig
}
func LoadAgent ¶
func LoadAgent(path string) (*AgentRuntimeConfig, error)
func (*AgentRuntimeConfig) ToAgentRuntimeConfig ¶
func (c *AgentRuntimeConfig) ToAgentRuntimeConfig() *AgentRuntimeConfig
type AgentRuntimeProvider ¶
type AgentRuntimeProvider interface {
ToAgentRuntimeConfig() *AgentRuntimeConfig
}
type Config ¶
type Config struct {
Role string `mapstructure:"role"`
Listen string `mapstructure:"listen"` // ":8140" | "unix:/run/gw.sock" | "unix:@name"(abstract, Linux)
LogLevel string `mapstructure:"log_level"`
Master MasterConfig `mapstructure:"master"`
Agent AgentConfig `mapstructure:"agent"`
Relay RelayConfig `mapstructure:"relay"`
EventBus EventBusConfig `mapstructure:"eventbus"`
Metrics MetricsConfig `mapstructure:"metrics"`
}
func (*Config) ToAgentRuntimeConfig ¶
func (c *Config) ToAgentRuntimeConfig() *AgentRuntimeConfig
func (*Config) ToMasterRuntimeConfig ¶
func (c *Config) ToMasterRuntimeConfig() *MasterRuntimeConfig
type EventBusConfig ¶
type FileConfig ¶
type FileConfig struct {
LogLevel string `mapstructure:"log_level"`
Master MasterConfig `mapstructure:"master"`
Agent AgentConfig `mapstructure:"agent"`
Runtime RuntimeConfig `mapstructure:"runtime"`
Relay RelayConfig `mapstructure:"relay"`
Metrics MetricsConfig `mapstructure:"metrics"`
}
type MasterConfig ¶
type MasterConfig struct {
Listen string `mapstructure:"listen"` // ":8140" | "unix:/run/gw.sock" | "unix:@name"(abstract, Linux)
DBPath string `mapstructure:"core_db_path"`
LogDBPath string `mapstructure:"log_db_path"`
LegacyDBPath string `mapstructure:"legacy_db_path"`
DeprecatedDBPath string `mapstructure:"db_path"`
UsesDeprecatedDBPath bool `mapstructure:"-"`
JWTSecret string `mapstructure:"jwt_secret"`
BYOKKEK string `mapstructure:"byok_kek"` // base64 32B; empty → HKDF derive from JWTSecret
EnrollmentTokenTTL int `mapstructure:"enrollment_token_ttl"`
AdminUser string `mapstructure:"admin_user"`
AdminPassword string `mapstructure:"admin_password"`
ProxyURL string `mapstructure:"proxy_url"`
PublicBaseURLs []string `mapstructure:"public_base_urls"`
}
type MasterRuntimeConfig ¶
type MasterRuntimeConfig struct {
LogLevel string
Master MasterConfig
Agent AgentConfig
Runtime RuntimeConfig
Relay RelayConfig
Metrics MetricsConfig
}
func LoadMaster ¶
func LoadMaster(path string) (*MasterRuntimeConfig, error)
func (*MasterRuntimeConfig) ToMasterRuntimeConfig ¶
func (c *MasterRuntimeConfig) ToMasterRuntimeConfig() *MasterRuntimeConfig
type MasterRuntimeProvider ¶
type MasterRuntimeProvider interface {
ToMasterRuntimeConfig() *MasterRuntimeConfig
}
type MetricsConfig ¶ added in v0.0.15
type RelayConfig ¶
type RelayConfig struct {
Timeout int `mapstructure:"timeout"`
MaxIdleConns int `mapstructure:"max_idle_conns"`
MaxIdleConnsPerHost int `mapstructure:"max_idle_conns_per_host"`
KeepaliveIdle int `mapstructure:"keepalive_idle"`
KeepaliveInterval int `mapstructure:"keepalive_interval"`
KeepaliveCount int `mapstructure:"keepalive_count"`
}
type RuntimeConfig ¶
type RuntimeConfig struct {
RelayTimeout int `mapstructure:"relay_timeout"`
FullSyncInterval int `mapstructure:"full_sync_interval"`
ReportBufferSize int `mapstructure:"report_buffer_size"`
ReportFlushInterval int `mapstructure:"report_flush_interval"`
HeartbeatInterval int `mapstructure:"heartbeat_interval"`
}
Click to show internal directories.
Click to hide internal directories.