Versions in this module Expand all Collapse all v0 v0.0.1 Nov 16, 2022 Changes in this version + var NAMESPACE_RESERVED_EVENTS = types.NewSet("connect", "connection", "new_namespace") + var SOCKET_RESERVED_EVENTS = types.NewSet("connect", "connect_error", "disconnect", "disconnecting", "newListener", ...) + type Adapter interface + AddAll func(string, *types.Set) + AddSockets func(*BroadcastOptions, []string) + Broadcast func(*parser.Packet, *BroadcastOptions) + BroadcastWithAck func(*parser.Packet, *BroadcastOptions, func(uint64), func(...interface{})) + Close func() + Del func(string, string) + DelAll func(string) + DelSockets func(*BroadcastOptions, []string) + DisconnectSockets func(*BroadcastOptions, bool) + FetchSockets func(*BroadcastOptions) []interface{} + Init func() + New func(NamespaceInterface) Adapter + Nsp func() NamespaceInterface + Rooms func() *sync.Map + ServerCount func() int64 + ServerSideEmit func(string, ...interface{}) error + SetBroadcast func(func(*parser.Packet, *BroadcastOptions)) + Sids func() *sync.Map + SocketRooms func(string) *types.Set + Sockets func(*types.Set) *types.Set + type BroadcastFlags struct + Binary bool + Broadcast bool + Local bool + Timeout *time.Duration + type BroadcastOperator struct + func NewBroadcastOperator(adapter Adapter, rooms *types.Set, exceptRooms *types.Set, ...) *BroadcastOperator + func (b *BroadcastOperator) AllSockets() (*types.Set, error) + func (b *BroadcastOperator) Compress(compress bool) *BroadcastOperator + func (b *BroadcastOperator) DisconnectSockets(status bool) + func (b *BroadcastOperator) Emit(ev string, args ...interface{}) error + func (b *BroadcastOperator) Except(room ...string) *BroadcastOperator + func (b *BroadcastOperator) FetchSockets() (remoteSockets []*RemoteSocket) + func (b *BroadcastOperator) In(room ...string) *BroadcastOperator + func (b *BroadcastOperator) Local() *BroadcastOperator + func (b *BroadcastOperator) SocketsJoin(room ...string) + func (b *BroadcastOperator) SocketsLeave(room ...string) + func (b *BroadcastOperator) Timeout(timeout time.Duration) *BroadcastOperator + func (b *BroadcastOperator) To(room ...string) *BroadcastOperator + func (b *BroadcastOperator) Volatile() *BroadcastOperator + type BroadcastOptions struct + Except *types.Set + Flags *BroadcastFlags + Rooms *types.Set + type Client struct + func NewClient(server *Server, conn engine.Socket) *Client + func (c *Client) Conn() engine.Socket + func (c *Client) Request() *types.HttpContext + func (c *Client) WriteToEngine(encodedPackets []types.BufferInterface, opts *WriteOptions) + type ExtendedError struct + func NewExtendedError(message string, data interface{}) *ExtendedError + func (e *ExtendedError) Data() interface{} + func (e *ExtendedError) Err() error + func (e *ExtendedError) Error() string + type Handshake struct + Address string + Auth interface{} + Headers *utils.ParameterBag + Issued int64 + Query *utils.ParameterBag + Secure bool + Time string + Url string + Xdomain bool + type Namespace struct + func NewNamespace(server *Server, name string) *Namespace + func (n *Namespace) Adapter() Adapter + func (n *Namespace) Add(client *Client, query interface{}, fn func(*Socket)) *Socket + func (n *Namespace) AllSockets() (*types.Set, error) + func (n *Namespace) Compress(compress bool) *BroadcastOperator + func (n *Namespace) DisconnectSockets(status bool) + func (n *Namespace) Emit(ev string, args ...interface{}) error + func (n *Namespace) EventEmitter() *StrictEventEmitter + func (n *Namespace) Except(room ...string) *BroadcastOperator + func (n *Namespace) FetchSockets() ([]*RemoteSocket, error) + func (n *Namespace) Ids() uint64 + func (n *Namespace) In(room ...string) *BroadcastOperator + func (n *Namespace) Local() *BroadcastOperator + func (n *Namespace) Name() string + func (n *Namespace) Send(args ...interface{}) NamespaceInterface + func (n *Namespace) Server() *Server + func (n *Namespace) ServerSideEmit(ev string, args ...interface{}) error + func (n *Namespace) Sockets() *sync.Map + func (n *Namespace) SocketsJoin(room ...string) + func (n *Namespace) SocketsLeave(room ...string) + func (n *Namespace) Timeout(timeout time.Duration) *BroadcastOperator + func (n *Namespace) To(room ...string) *BroadcastOperator + func (n *Namespace) Use(fn func(*Socket, func(*ExtendedError))) NamespaceInterface + func (n *Namespace) Volatile() *BroadcastOperator + func (n *Namespace) Write(args ...interface{}) NamespaceInterface + type NamespaceInterface interface + Adapter func() Adapter + Add func(*Client, interface{}, func(*Socket)) *Socket + AllSockets func() (*types.Set, error) + Compress func(bool) *BroadcastOperator + DisconnectSockets func(bool) + Emit func(string, ...interface{}) error + EmitReserved func(string, ...interface{}) + EmitUntyped func(string, ...interface{}) + EventEmitter func() *StrictEventEmitter + Except func(...string) *BroadcastOperator + FetchSockets func() ([]*RemoteSocket, error) + Ids func() uint64 + In func(...string) *BroadcastOperator + Listeners func(string) []events.Listener + Local func() *BroadcastOperator + Name func() string + On func(string, ...events.Listener) error + Once func(string, ...events.Listener) error + Send func(...interface{}) NamespaceInterface + Server func() *Server + ServerSideEmit func(string, ...interface{}) error + Sockets func() *sync.Map + SocketsJoin func(...string) + SocketsLeave func(...string) + Timeout func(time.Duration) *BroadcastOperator + To func(...string) *BroadcastOperator + Use func(func(*Socket, func(*ExtendedError))) NamespaceInterface + Volatile func() *BroadcastOperator + Write func(...interface{}) NamespaceInterface + type ParentNamespace struct + func NewParentNamespace(server *Server) *ParentNamespace + func (p *ParentNamespace) CreateChild(name string) *Namespace + func (p *ParentNamespace) Emit(ev string, args ...interface{}) error + func (p *ParentNamespace) FetchSockets() ([]*RemoteSocket, error) + type ParentNspNameMatchFn *func(string, interface{}, func(error, bool)) + type RemoteSocket struct + func NewRemoteSocket(adapter Adapter, details SocketDetails) *RemoteSocket + func (r *RemoteSocket) Data() interface{} + func (r *RemoteSocket) Disconnect(status bool) *RemoteSocket + func (r *RemoteSocket) Emit(ev string, args ...interface{}) error + func (r *RemoteSocket) Handshake() *Handshake + func (r *RemoteSocket) Id() string + func (r *RemoteSocket) Join(room ...string) + func (r *RemoteSocket) Leave(room ...string) + func (r *RemoteSocket) Rooms() *types.Set + type Server struct + func NewServer(srv interface{}, opts *ServerOptions) *Server + func (s *Server) Adapter() Adapter + func (s *Server) AllSockets() (*types.Set, error) + func (s *Server) Attach(srv interface{}, opts *ServerOptions) *Server + func (s *Server) Bind(egs engine.Server) *Server + func (s *Server) Close(fn func()) + func (s *Server) Compress(compress bool) *BroadcastOperator + func (s *Server) ConnectTimeout() time.Duration + func (s *Server) DisconnectSockets(status bool) + func (s *Server) Encoder() parser.Encoder + func (s *Server) Engine() engine.Server + func (s *Server) Except(room ...string) *BroadcastOperator + func (s *Server) FetchSockets() ([]*RemoteSocket, error) + func (s *Server) In(room ...string) *BroadcastOperator + func (s *Server) Listen(srv interface{}, opts *ServerOptions) *Server + func (s *Server) Local() *BroadcastOperator + func (s *Server) Of(name interface{}, fn func(...interface{})) NamespaceInterface + func (s *Server) Path() string + func (s *Server) Send(args ...interface{}) *Server + func (s *Server) ServeClient() bool + func (s *Server) ServeHandler(opts *ServerOptions) http.Handler + func (s *Server) ServerSideEmit(ev string, args ...interface{}) error + func (s *Server) SetAdapter(v Adapter) *Server + func (s *Server) SetConnectTimeout(v time.Duration) *Server + func (s *Server) SetPath(v string) *Server + func (s *Server) SetServeClient(v bool) *Server + func (s *Server) Sockets() NamespaceInterface + func (s *Server) SocketsJoin(room ...string) + func (s *Server) SocketsLeave(room ...string) + func (s *Server) Timeout(timeout time.Duration) *BroadcastOperator + func (s *Server) To(room ...string) *BroadcastOperator + func (s *Server) Use(fn func(*Socket, func(*ExtendedError))) *Server + func (s *Server) Volatile() *BroadcastOperator + func (s *Server) Write(args ...interface{}) *Server + type ServerOptions struct + func DefaultServerOptions() *ServerOptions + func (s *ServerOptions) Adapter() Adapter + func (s *ServerOptions) Assign(data ServerOptionsInterface) (ServerOptionsInterface, error) + func (s *ServerOptions) ConnectTimeout() time.Duration + func (s *ServerOptions) GetRawAdapter() Adapter + func (s *ServerOptions) GetRawConnectTimeout() *time.Duration + func (s *ServerOptions) GetRawParser() parser.Parser + func (s *ServerOptions) GetRawServeClient() *bool + func (s *ServerOptions) Parser() parser.Parser + func (s *ServerOptions) Path() string + func (s *ServerOptions) ServeClient() bool + func (s *ServerOptions) SetAdapter(adapter Adapter) + func (s *ServerOptions) SetConnectTimeout(connectTimeout time.Duration) + func (s *ServerOptions) SetParser(parser parser.Parser) + func (s *ServerOptions) SetServeClient(serveClient bool) + type ServerOptionsInterface interface + Adapter func() Adapter + ConnectTimeout func() time.Duration + GetRawAdapter func() Adapter + GetRawConnectTimeout func() *time.Duration + GetRawParser func() parser.Parser + GetRawServeClient func() *bool + Parser func() parser.Parser + ServeClient func() bool + SetAdapter func(adapter Adapter) + SetConnectTimeout func(connectTimeout time.Duration) + SetParser func(parser parser.Parser) + SetServeClient func(serveClient bool) + type Set struct + func NewSet(keys ...*Namespace) *Set + func (s *Set) Add(keys ...*Namespace) bool + func (s *Set) All() map[*Namespace]Void + func (s *Set) Clear() bool + func (s *Set) Delete(keys ...*Namespace) bool + func (s *Set) Has(key *Namespace) bool + func (s *Set) Keys() (list []*Namespace) + func (s *Set) Len() int + type Socket struct + func NewSocket(nsp *Namespace, client *Client, auth interface{}) *Socket + func (s *Socket) Acks() *sync.Map + func (s *Socket) Broadcast() *BroadcastOperator + func (s *Socket) Client() *Client + func (s *Socket) Compress(compress bool) *Socket + func (s *Socket) Conn() engine.Socket + func (s *Socket) Connected() bool + func (s *Socket) Data() interface{} + func (s *Socket) Disconnect(status bool) *Socket + func (s *Socket) Disconnected() bool + func (s *Socket) Emit(ev string, args ...interface{}) error + func (s *Socket) Except(room ...string) *BroadcastOperator + func (s *Socket) Handshake() *Handshake + func (s *Socket) Id() string + func (s *Socket) In(room ...string) *BroadcastOperator + func (s *Socket) Join(rooms ...string) + func (s *Socket) Leave(room string) + func (s *Socket) ListenersAny() []events.Listener + func (s *Socket) ListenersAnyOutgoing() []events.Listener + func (s *Socket) Local() *BroadcastOperator + func (s *Socket) NotifyOutgoingListeners() func(*parser.Packet) + func (s *Socket) Nsp() *Namespace + func (s *Socket) OffAny(listener events.Listener) *Socket + func (s *Socket) OffAnyOutgoing(listener events.Listener) *Socket + func (s *Socket) OnAny(listener events.Listener) *Socket + func (s *Socket) OnAnyOutgoing(listener events.Listener) *Socket + func (s *Socket) PrependAny(listener events.Listener) *Socket + func (s *Socket) PrependAnyOutgoing(listener events.Listener) *Socket + func (s *Socket) Request() *types.HttpContext + func (s *Socket) Rooms() *types.Set + func (s *Socket) Send(args ...interface{}) *Socket + func (s *Socket) SetData(data interface{}) + func (s *Socket) Timeout(timeout time.Duration) *Socket + func (s *Socket) To(room ...string) *BroadcastOperator + func (s *Socket) Use(fn func([]interface{}, func(error))) *Socket + func (s *Socket) Volatile() *Socket + func (s *Socket) Write(args ...interface{}) *Socket + type SocketDetails interface + Data func() interface{} + Handshake func() *Handshake + Id func() string + Rooms func() *types.Set + type StrictEventEmitter struct + func NewStrictEventEmitter() *StrictEventEmitter + func (s *StrictEventEmitter) Emit(ev string, args ...interface{}) + func (s *StrictEventEmitter) EmitReserved(ev string, args ...interface{}) + func (s *StrictEventEmitter) EmitUntyped(ev string, args ...interface{}) + func (s *StrictEventEmitter) Listeners(ev string) []events.Listener + func (s *StrictEventEmitter) On(ev string, listeners ...events.Listener) error + func (s *StrictEventEmitter) Once(ev string, listeners ...events.Listener) error + type Void struct + var NULL Void + type WriteOptions struct + PreEncoded bool + Volatile bool + WsPreEncoded string