types

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	SOCKETS adapter.MessageType = iota
	ALL_ROOMS
	REMOTE_JOIN
	REMOTE_LEAVE
	REMOTE_DISCONNECT
	REMOTE_FETCH
	SERVER_SIDE_EMIT
	BROADCAST
	BROADCAST_CLIENT_COUNT
	BROADCAST_ACK
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser interface {
	Encode(any) ([]byte, error)
	Decode([]byte, any) error
}

type RedisClient

type RedisClient struct {
	events.EventEmitter

	Client  redis.UniversalClient
	Context context.Context
}

func NewRedisClient

func NewRedisClient(ctx context.Context, redis redis.UniversalClient) *RedisClient

type RedisPacket added in v1.1.1

type RedisPacket struct {
	Uid    adapter.ServerId       `json:"uid,omitempty" msgpack:"uid,omitempty"`
	Packet *parser.Packet         `json:"packet,omitempty" msgpack:"packet,omitempty"`
	Opts   *adapter.PacketOptions `json:"opts,omitempty" msgpack:"opts,omitempty"`
}

type RedisRequest added in v1.1.1

type RedisRequest struct {
	Type      adapter.MessageType    `json:"type,omitempty" msgpack:"type,omitempty"`
	RequestId string                 `json:"requestId,omitempty" msgpack:"requestId,omitempty"`
	Rooms     []socket.Room          `json:"rooms,omitempty" msgpack:"rooms,omitempty"`
	Opts      *adapter.PacketOptions `json:"opts,omitempty" msgpack:"opts,omitempty"`
	Sid       socket.SocketId        `json:"sid,omitempty" msgpack:"sid,omitempty"`
	Room      socket.Room            `json:"room,omitempty" msgpack:"room,omitempty"`
	Close     bool                   `json:"close,omitempty" msgpack:"close,omitempty"`
	Uid       adapter.ServerId       `json:"uid,omitempty" msgpack:"uid,omitempty"`
	Data      []any                  `json:"data,omitempty" msgpack:"data,omitempty"`
	Packet    *parser.Packet         `json:"packet,omitempty" msgpack:"packet,omitempty"`
}

type RedisResponse added in v1.1.1

type RedisResponse struct {
	Type        adapter.MessageType       `json:"type,omitempty" msgpack:"type,omitempty"`
	RequestId   string                    `json:"requestId,omitempty" msgpack:"requestId,omitempty"`
	Rooms       []socket.Room             `json:"rooms,omitempty" msgpack:"rooms,omitempty"`
	Sockets     []*adapter.SocketResponse `json:"sockets,omitempty" msgpack:"sockets,omitempty"`
	Data        []any                     `json:"data,omitempty" msgpack:"data,omitempty"`
	ClientCount uint64                    `json:"clientcount,omitempty" msgpack:"clientcount,omitempty"`
	Packet      []any                     `json:"packet,omitempty" msgpack:"packet,omitempty"`
}

type String added in v1.1.0

type String struct {
	// contains filtered or unexported fields
}

A String is an atomic string value. The zero value is "".

func (*String) CompareAndSwap added in v1.1.0

func (s *String) CompareAndSwap(old, new string) (swapped bool)

CompareAndSwap executes the compare-and-swap operation for the string value x.

func (*String) Load added in v1.1.0

func (s *String) Load() string

Load atomically loads and returns the value stored in x.

func (*String) Store added in v1.1.0

func (s *String) Store(val string)

Store atomically stores val into x.

func (*String) Swap added in v1.1.0

func (s *String) Swap(new string) (old string)

Swap atomically stores new into x and returns the previous value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL