Documentation
¶
Index ¶
- Constants
- Variables
- type BroadcastOperator
- func (b *BroadcastOperator) Compress(compress bool) *BroadcastOperator
- func (b *BroadcastOperator) Construct(redisClient *_types.RedisClient, broadcastOptions *BroadcastOptions, ...)
- func (b *BroadcastOperator) DisconnectSockets(state bool) error
- func (b *BroadcastOperator) Emit(ev string, args ...any) error
- func (b *BroadcastOperator) Except(room ...socket.Room) *BroadcastOperator
- func (b *BroadcastOperator) In(room ...socket.Room) *BroadcastOperator
- func (b *BroadcastOperator) SocketsJoin(rooms ...socket.Room) error
- func (b *BroadcastOperator) SocketsLeave(rooms ...socket.Room) error
- func (b *BroadcastOperator) To(room ...socket.Room) *BroadcastOperator
- func (b *BroadcastOperator) Volatile() *BroadcastOperator
- type BroadcastOptions
- type Emitter
- func (e *Emitter) Compress(compress bool) *BroadcastOperator
- func (e *Emitter) Construct(redisClient *types.RedisClient, opts *EmitterOptions, nsps ...string)
- func (e *Emitter) DisconnectSockets(state bool) error
- func (e *Emitter) Emit(ev string, args ...any) error
- func (e *Emitter) Except(rooms ...socket.Room) *BroadcastOperator
- func (e *Emitter) In(rooms ...socket.Room) *BroadcastOperator
- func (e *Emitter) Of(nsp string) *Emitter
- func (e *Emitter) ServerSideEmit(args ...any) error
- func (e *Emitter) SocketsJoin(rooms ...socket.Room) error
- func (e *Emitter) SocketsLeave(rooms ...socket.Room) error
- func (e *Emitter) To(rooms ...socket.Room) *BroadcastOperator
- func (e *Emitter) Volatile() *BroadcastOperator
- type EmitterOptions
- func (s *EmitterOptions) Assign(data EmitterOptionsInterface) (EmitterOptionsInterface, error)
- func (s *EmitterOptions) GetRawKey() *string
- func (s *EmitterOptions) GetRawParser() types.Parser
- func (s *EmitterOptions) Key() string
- func (s *EmitterOptions) Parser() types.Parser
- func (s *EmitterOptions) SetKey(key string)
- func (s *EmitterOptions) SetParser(parser types.Parser)
- type EmitterOptionsInterface
- type Packet
- type Request
- type Response
Constants ¶
const UID adapter.ServerId = "emitter"
Variables ¶
var RESERVED_EVENTS = types.NewSet(
"connect",
"connect_error",
"disconnect",
"disconnecting",
"newListener",
"removeListener",
)
Functions ¶
This section is empty.
Types ¶
type BroadcastOperator ¶
type BroadcastOperator struct {
// contains filtered or unexported fields
}
func MakeBroadcastOperator ¶
func MakeBroadcastOperator() *BroadcastOperator
func NewBroadcastOperator ¶
func NewBroadcastOperator(redisClient *_types.RedisClient, broadcastOptions *BroadcastOptions, rooms *types.Set[socket.Room], exceptRooms *types.Set[socket.Room], flags *socket.BroadcastFlags) *BroadcastOperator
func (*BroadcastOperator) Compress ¶
func (b *BroadcastOperator) Compress(compress bool) *BroadcastOperator
Sets the compress flag.
func (*BroadcastOperator) Construct ¶
func (b *BroadcastOperator) Construct(redisClient *_types.RedisClient, broadcastOptions *BroadcastOptions, rooms *types.Set[socket.Room], exceptRooms *types.Set[socket.Room], flags *socket.BroadcastFlags)
func (*BroadcastOperator) DisconnectSockets ¶
func (b *BroadcastOperator) DisconnectSockets(state bool) error
Makes the matching socket instances disconnect
func (*BroadcastOperator) Emit ¶
func (b *BroadcastOperator) Emit(ev string, args ...any) error
Emits to all clients.
func (*BroadcastOperator) Except ¶
func (b *BroadcastOperator) Except(room ...socket.Room) *BroadcastOperator
Excludes a room when emitting.
func (*BroadcastOperator) In ¶
func (b *BroadcastOperator) In(room ...socket.Room) *BroadcastOperator
Targets a room when emitting.
func (*BroadcastOperator) SocketsJoin ¶
func (b *BroadcastOperator) SocketsJoin(rooms ...socket.Room) error
Makes the matching socket instances join the specified rooms
func (*BroadcastOperator) SocketsLeave ¶
func (b *BroadcastOperator) SocketsLeave(rooms ...socket.Room) error
Makes the matching socket instances leave the specified rooms
func (*BroadcastOperator) To ¶
func (b *BroadcastOperator) To(room ...socket.Room) *BroadcastOperator
Targets a room when emitting.
func (*BroadcastOperator) Volatile ¶
func (b *BroadcastOperator) Volatile() *BroadcastOperator
Sets a modifier for a subsequent event emission that the event data may be lost if the client is not ready to receive messages (because of network slowness or other issues, or because they’re connected through long polling and is in the middle of a request-response cycle).
type BroadcastOptions ¶
type Emitter ¶
type Emitter struct {
// contains filtered or unexported fields
}
func MakeEmitter ¶
func MakeEmitter() *Emitter
func NewEmitter ¶
func NewEmitter(redisClient *types.RedisClient, opts *EmitterOptions, nsps ...string) *Emitter
func (*Emitter) Compress ¶
func (e *Emitter) Compress(compress bool) *BroadcastOperator
Sets the compress flag.
compress - if `true`, compresses the sending data
func (*Emitter) Construct ¶
func (e *Emitter) Construct(redisClient *types.RedisClient, opts *EmitterOptions, nsps ...string)
func (*Emitter) DisconnectSockets ¶
Makes the matching socket instances disconnect
func (*Emitter) Except ¶
func (e *Emitter) Except(rooms ...socket.Room) *BroadcastOperator
Excludes a room when emitting.
func (*Emitter) In ¶
func (e *Emitter) In(rooms ...socket.Room) *BroadcastOperator
Targets a room when emitting.
func (*Emitter) ServerSideEmit ¶
Send a packet to the Socket.IO servers in the cluster
func (*Emitter) SocketsJoin ¶
Makes the matching socket instances join the specified rooms
func (*Emitter) SocketsLeave ¶
Makes the matching socket instances leave the specified rooms
func (*Emitter) To ¶
func (e *Emitter) To(rooms ...socket.Room) *BroadcastOperator
Targets a room when emitting.
func (*Emitter) Volatile ¶
func (e *Emitter) Volatile() *BroadcastOperator
Sets a modifier for a subsequent event emission that the event data may be lost if the client is not ready to receive messages (because of network slowness or other issues, or because they’re connected through long polling and is in the middle of a request-response cycle).
type EmitterOptions ¶
type EmitterOptions struct {
// contains filtered or unexported fields
}
func DefaultEmitterOptions ¶
func DefaultEmitterOptions() *EmitterOptions
func (*EmitterOptions) Assign ¶
func (s *EmitterOptions) Assign(data EmitterOptionsInterface) (EmitterOptionsInterface, error)
func (*EmitterOptions) GetRawKey ¶
func (s *EmitterOptions) GetRawKey() *string
func (*EmitterOptions) GetRawParser ¶
func (s *EmitterOptions) GetRawParser() types.Parser
func (*EmitterOptions) Parser ¶
func (s *EmitterOptions) Parser() types.Parser
The parser to use for encoding messages sent to Redis. Defaults to msgpack, a MessagePack implementation.
func (*EmitterOptions) SetKey ¶
func (s *EmitterOptions) SetKey(key string)
func (*EmitterOptions) SetParser ¶
func (s *EmitterOptions) SetParser(parser types.Parser)
type EmitterOptionsInterface ¶
type Packet ¶ added in v1.1.1
type Packet = types.RedisPacket
type Request ¶ added in v1.1.1
type Request = types.RedisRequest
type Response ¶ added in v1.1.1
type Response = types.RedisResponse