Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Enabled bool `yaml:"enabled"`
Server ServerConfig `yaml:"server"`
Routing RoutingConfig `yaml:"routing"`
Security SecurityConfig `yaml:"security"`
TenantMode string `yaml:"tenantMode"`
Events EventsConfig `yaml:"events"`
}
Config holds the WebSocket module configuration.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns a Config with sensible defaults.
type EventsConfig ¶
type EventsConfig struct {
AllowedEventTypes []string `yaml:"allowedEventTypes"`
InternalEventPrefix string `yaml:"internalEventPrefix"`
// PresenceDebounce is the grace window before a user's "went offline"
// presence transition is broadcast, so a quick reconnect (page reload,
// brief network blip) doesn't flicker. Set to 0 to disable debouncing.
PresenceDebounce time.Duration `yaml:"presenceDebounce"`
}
EventsConfig holds event bridging settings.
type RoutingConfig ¶
type RoutingConfig struct {
MaxTopicLength int `yaml:"maxTopicLength"`
MaxTopicsPerConnection int `yaml:"maxTopicsPerConnection"`
}
RoutingConfig holds message routing settings.
type SecurityConfig ¶
type SecurityConfig struct {
AuthRequired bool `yaml:"authRequired"`
AllowOrigins []string `yaml:"allowOrigins"`
JWTSecret string `yaml:"jwtSecret"`
}
SecurityConfig holds WebSocket security settings.
type ServerConfig ¶
type ServerConfig struct {
Host string `yaml:"host"`
Port string `yaml:"port"`
ReadBufferSize int `yaml:"readBufferSize"`
WriteBufferSize int `yaml:"writeBufferSize"`
ReadDeadline time.Duration `yaml:"readDeadline"`
WriteDeadline time.Duration `yaml:"writeDeadline"`
// PingInterval controls how often the server sends a WebSocket ping
// frame to keep idle connections (and any intermediate proxies/load
// balancers) alive. Set to 0 to disable.
PingInterval time.Duration `yaml:"pingInterval"`
MaxConnections int64 `yaml:"maxConnections"`
MaxConnectionsPerUser int `yaml:"maxConnectionsPerUser"`
MaxConnectionsPerTenant int `yaml:"maxConnectionsPerTenant"`
}
ServerConfig holds WebSocket server settings.
Click to show internal directories.
Click to hide internal directories.