Versions in this module Expand all Collapse all v1 v1.2.0 Aug 15, 2026 Changes in this version type Server + func (s *Server) SetUnknownEventAck(nsp string, data []any) v1.1.0 Aug 14, 2026 Changes in this version + var ErrHandlerMismatch = errors.New("socketio: handler signature mismatch") + var ErrInvalidNamespace = errors.New("socketio: invalid namespace") + var ErrNamespaceNotConnected = fmt.Errorf("%w: namespace not connected", ErrNotConnected) + type Adapter interface + AddSocket func(id string) + AddToRoom func(room, id string) + Broadcast func(room string, except []string, deliver func(id string)) + Close func() error + RemoveFromRoom func(room, id string) + RemoveSocket func(id string) + Sockets func() []string + SocketsCount func() int + func NewMemoryAdapter() Adapter + type AdapterFactory func(nsp string) Adapter type BroadcastOperator + func (b *BroadcastOperator) Except(ids ...string) *BroadcastOperator + type CORSConfig struct + AllowAll bool + AllowedOrigins []string + func AllowAll() *CORSConfig type Client + func (c *Client) OnError(nsp string, f func(err error)) type Server + func NewServerWithConfig(cfg *ServerConfig) *Server + func (s *Server) OnAny(nsp string, f func(*Socket, string, []any)) + func (s *Server) OnError(nsp string, f func(*Socket, error)) + func (s *Server) RegisterNamespace(nsp string) error + func (s *Server) SetAdapterFactory(f AdapterFactory) + func (s *Server) ToExcept(nsp, room string, except []string, event string, args ...any) error + type ServerConfig struct + Adapter AdapterFactory + CORS *CORSConfig + Engine *engineio.Options + Path string type Socket + func (s *Socket) ToExcept(room string, except []string) *BroadcastOperator v1.0.0 Aug 14, 2026 Changes in this version + var ErrNotConnected = errors.New("socketio: socket is not connected") + var NopLogger engineio.Logger = slogLogger + type BroadcastOperator struct + func (b *BroadcastOperator) Emit(event string, args ...any) + type Client struct + func Dial(ctx context.Context, rawURL string, opts *Options) (*Client, error) + func (c *Client) Close() error + func (c *Client) ConnectNamespace(ctx context.Context, nsp string, data map[string]any) error + func (c *Client) Connected(nsp string) bool + func (c *Client) DisconnectNamespace(nsp string) + func (c *Client) Emit(nsp, event string, args ...any) error + func (c *Client) EmitWithAck(nsp, event string, cb func(args []any), args ...any) (int64, error) + func (c *Client) ID(nsp string) string + func (c *Client) OnConnect(nsp string, f func()) + func (c *Client) OnConnectError(nsp string, f func(err error)) + func (c *Client) OnDisconnect(nsp string, f func(reason string)) + func (c *Client) OnEvent(nsp, event string, f any) + func (c *Client) SetLogger(l engineio.Logger) + type Middleware func(s *Socket, data map[string]any) error + type Options struct + Auth map[string]any + Engine *engineio.Options + RandomizationFactor float64 + Reconnection bool + ReconnectionAttempts int + ReconnectionDelay time.Duration + ReconnectionDelayMax time.Duration + Timeout time.Duration + Transports []string + type Packet struct + Attachments int + Data any + ID int64 + Nsp string + Type PacketType + func Decode(data []byte) (*Packet, error) + func (p *Packet) Encode() []byte + type PacketType byte + const Ack + const BinaryAck + const BinaryEvent + const Connect + const ConnectError + const Disconnect + const Event + func (t PacketType) String() string + type Server struct + func NewServer(opts *engineio.Options) *Server + func (s *Server) BroadcastToNamespace(nsp, event string, args ...any) + func (s *Server) BroadcastToRoom(nsp, room, event string, args ...any) + func (s *Server) Close() + func (s *Server) Engine() *engineio.Server + func (s *Server) Namespace(nsp string) *namespace + func (s *Server) OnConnect(nsp string, f func(*Socket) error) + func (s *Server) OnDisconnect(nsp string, f func(*Socket, string)) + func (s *Server) OnEvent(nsp, event string, f any) + func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (s *Server) SetLogger(l engineio.Logger) + func (s *Server) Use(nsp string, m Middleware) + type Socket struct + func (s *Socket) Broadcast(event string, args ...any) + func (s *Socket) BroadcastToRoom(room, event string, args ...any) + func (s *Socket) Connected() bool + func (s *Socket) Disconnect() + func (s *Socket) Emit(event string, args ...any) error + func (s *Socket) EmitWithAck(event string, cb func(args []any), args ...any) (int64, error) + func (s *Socket) Engine() *engineio.Socket + func (s *Socket) ID() string + func (s *Socket) JoinRoom(room string) + func (s *Socket) LeaveRoom(room string) + func (s *Socket) Nsp() string + func (s *Socket) RemoteAddr() string + func (s *Socket) To(room string) *BroadcastOperator