Versions in this module Expand all Collapse all v1 v1.0.2 Aug 12, 2026 v1.0.1 Aug 10, 2026 v1.0.0 Aug 10, 2026 Changes in this version + func SetDebugLogger(logger Logger) + func SetErrorLogger(logger Logger) + func SetInfoLogger(logger Logger) + func SetLogger(logger Logger) + func SetWarnLogger(logger Logger) + type Authenticator interface + Authenticate func(credential string) (deviceID string, allowed bool) + type ConnectionListener interface + OnConnectionClosed func(deviceID string, reason string) + OnConnectionEstablished func(deviceID string) + type ConnectionStore struct + func NewConnectionStore() *ConnectionStore + func (s *ConnectionStore) All() []DeviceConnection + func (s *ConnectionStore) Get(deviceID string) (DeviceConnection, bool) + func (s *ConnectionStore) Register(deviceID string, conn DeviceConnection) (prev DeviceConnection) + func (s *ConnectionStore) Remove(deviceID string, conn DeviceConnection) bool + type DeviceConnection interface + Close func() + DeviceID func() string + IsActive func() bool + SendDisconnect func(reason byte) + Write func(payload []byte) error + type KeepalivePolicy struct + AllowDisable bool + DefaultSeconds int64 + MaxSeconds int64 + MinSeconds int64 + func DefaultKeepalivePolicy() *KeepalivePolicy + func (p *KeepalivePolicy) Decide(clientKp int64) int64 + type Listener interface + Close func() error + Serve func(ctx context.Context, handler func(net.Conn)) error + func NewKCPListener(addr string) Listener + func NewQUICListener(addr string, config *tls.Config) Listener + func NewQUICListenerWithConfig(addr string, config *tls.Config, quicCfg *quic.Config) Listener + func NewTCPListener(addr string) Listener + func NewTLSListener(addr string, config *tls.Config) Listener + func NewWSListener(addr, path string) Listener + func NewWSSListener(addr, path string, config *tls.Config) Listener + type Logger interface + Printf func(format string, v ...interface{}) + Println func(v ...interface{}) + var DEBUG Logger = NOOPLogger{} + var ERROR Logger = NOOPLogger{} + var INFO Logger = NOOPLogger{} + var WARN Logger = NOOPLogger{} + type MessageHandler func(deviceID string, payload []byte) + type NOOPLogger struct + func (NOOPLogger) Printf(format string, v ...interface{}) + func (NOOPLogger) Println(v ...interface{}) + type Server interface + Close func() error + Kick func(deviceID string, reason byte) error + ListenAndServe func() error + ListenAndServeContext func(ctx context.Context) error + Push func(deviceID string, payload []byte) error + func NewServer(opts *ServerOptions) Server + type ServerOptions struct + Authenticator Authenticator + ConnectionListener ConnectionListener + KeepalivePolicy *KeepalivePolicy + MessageHandler MessageHandler + Port int + func NewServerOptions() *ServerOptions + func (o *ServerOptions) AddListener(l Listener) *ServerOptions + func (o *ServerOptions) SetAuthenticator(auth Authenticator) *ServerOptions + func (o *ServerOptions) SetConnectionListener(listener ConnectionListener) *ServerOptions + func (o *ServerOptions) SetKeepalivePolicy(policy *KeepalivePolicy) *ServerOptions + func (o *ServerOptions) SetMessageHandler(handler MessageHandler) *ServerOptions + func (o *ServerOptions) SetPort(port int) *ServerOptions