room

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLocalRoom

func NewLocalRoom(opt *room.Info, event event.EventEmitter, addressManager *rpc.AddressManager) (room.Room, error)

func NewRemoteRoom

func NewRemoteRoom(connection *room.Connection, opt *room.Info, eventEmitter event.EventEmitter, rpcRoom room.RpcRoom) (room.RemoteRoom, error)

Types

type BasicManager

type BasicManager struct {
	state.StatusMachine
	// contains filtered or unexported fields
}

func NewBasicManager

func NewBasicManager() *BasicManager

type LocalRoomManager

type LocalRoomManager struct {
	BasicManager
	AddressManager *rpc.AddressManager
	// contains filtered or unexported fields
}

func NewLocalRoomManager

func NewLocalRoomManager(event event.EventEmitter, addressManager *rpc.AddressManager, maxRoomSize int64) *LocalRoomManager

func (*LocalRoomManager) CreateConnection

func (r *LocalRoomManager) CreateConnection() (*room.Connection, error)

func (*LocalRoomManager) CreateRoom

func (r *LocalRoomManager) CreateRoom(ctx context.Context, info *room.Info) (room.Room, error)

func (*LocalRoomManager) GetRoom

func (r *LocalRoomManager) GetRoom(ctx context.Context, opt *room.Info) (room.Room, error)

func (*LocalRoomManager) GetRooms

func (r *LocalRoomManager) GetRooms() []room.Room

func (*LocalRoomManager) GetRoomsByGroup

func (r *LocalRoomManager) GetRoomsByGroup(tags map[string]string) []room.Room

func (*LocalRoomManager) JoinRoom

func (r *LocalRoomManager) JoinRoom(ctx context.Context, opt *room.Info, connection *room.Connection) error

func (*LocalRoomManager) LeaveRoom

func (r *LocalRoomManager) LeaveRoom(ctx context.Context, opt *room.Info, connection *room.Connection) error

func (*LocalRoomManager) RemoveRoom

func (r *LocalRoomManager) RemoveRoom(ctx context.Context, opt *room.Info) error

func (*LocalRoomManager) Start

func (r *LocalRoomManager) Start()

func (*LocalRoomManager) UpdateRoomOption

func (r *LocalRoomManager) UpdateRoomOption(ctx context.Context, info *room.Info) (room.Room, error)

type LocalRpcRoomManager

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

func NewLocalRpcRoomManager

func NewLocalRpcRoomManager(localRoomManager *LocalRoomManager, rpcManager *rpc.RpcManager) (*LocalRpcRoomManager, error)

func (*LocalRpcRoomManager) CreateConnection

func (*LocalRpcRoomManager) CreateRoom

func (*LocalRpcRoomManager) GetRoom

func (*LocalRpcRoomManager) GetRooms

func (*LocalRpcRoomManager) GetRoomsByGroup

func (*LocalRpcRoomManager) JoinRoom

func (*LocalRpcRoomManager) LeaveRoom

func (*LocalRpcRoomManager) RemoveRoom

func (*LocalRpcRoomManager) UpdateRoomOption

type RemoteRpcRoomManager

type RemoteRpcRoomManager struct {
	BasicManager
	AddressManager *localRpc.AddressManager
	// contains filtered or unexported fields
}

func NewRemoteRpcRoomManager

func NewRemoteRpcRoomManager(addressManager *localRpc.AddressManager,
	rpcManager *localRpc.RpcManager,
	event event.EventEmitter,
	localRoomManager *LocalRoomManager) *RemoteRpcRoomManager

func (*RemoteRpcRoomManager) CreateConnection

func (r *RemoteRpcRoomManager) CreateConnection() *room.Connection

func (*RemoteRpcRoomManager) CreateLocalRoom

func (r *RemoteRpcRoomManager) CreateLocalRoom(ctx context.Context, info *room.Info) (room.Room, error)

func (*RemoteRpcRoomManager) CreateRemoteRoom

func (r *RemoteRpcRoomManager) CreateRemoteRoom(ctx context.Context, info *room.Info) (room.Room, error)

func (*RemoteRpcRoomManager) CreateRoom

func (r *RemoteRpcRoomManager) CreateRoom(ctx context.Context, info *room.Info) (room.Room, error)

func (*RemoteRpcRoomManager) ForceJoinRoom

func (r *RemoteRpcRoomManager) ForceJoinRoom(ctx context.Context, connection *room.Connection, opt *room.Info, roomOpt *room.Info) (room.RemoteRoom, error)

func (*RemoteRpcRoomManager) GetRoom

func (r *RemoteRpcRoomManager) GetRoom(ctx context.Context, info *room.Info) (room.Room, error)

func (*RemoteRpcRoomManager) GetRoomUsers

func (r *RemoteRpcRoomManager) GetRoomUsers(ctx context.Context, info *room.Info) ([]*room.Connection, error)

func (*RemoteRpcRoomManager) GetRooms

func (r *RemoteRpcRoomManager) GetRooms(ctx context.Context) ([]room.RemoteRoom, error)

func (*RemoteRpcRoomManager) GetRoomsByGroup

func (r *RemoteRpcRoomManager) GetRoomsByGroup(ctx context.Context, tags map[string]string) ([]room.RemoteRoom, error)

func (*RemoteRpcRoomManager) JoinRoom

func (r *RemoteRpcRoomManager) JoinRoom(ctx context.Context, connection *room.Connection, opt *room.Info) (room.RemoteRoom, error)

func (*RemoteRpcRoomManager) LeaveRoom

func (r *RemoteRpcRoomManager) LeaveRoom(ctx context.Context, info *room.Info, connection *room.Connection) error

func (*RemoteRpcRoomManager) ListRooms

func (r *RemoteRpcRoomManager) ListRooms(ctx context.Context, tags map[string]string) ([]*room.Info, error)

func (*RemoteRpcRoomManager) RemoveRoom

func (r *RemoteRpcRoomManager) RemoveRoom(ctx context.Context, info *room.Info) error

func (*RemoteRpcRoomManager) Start

func (r *RemoteRpcRoomManager) Start()

func (*RemoteRpcRoomManager) UpdateRoomOption

func (r *RemoteRpcRoomManager) UpdateRoomOption(ctx context.Context, info *room.Info) (*room.Info, error)

type RpcLocalRoomManagerRequest

type RpcLocalRoomManagerRequest struct {
	ContextTimeout int
	Tags           map[string]string
	Info           *room.Info
	Connection     *room.Connection
}

func NewRpcLocalRoomManagerRequest

func NewRpcLocalRoomManagerRequest() *RpcLocalRoomManagerRequest

type RpcLocalRoomManagerResponse

type RpcLocalRoomManagerResponse struct {
	room.BasicRpcResponse
	Connection *room.Connection
	Rooms      []*localRoom
	Room       *localRoom
}

func NewRpcLocalRoomManagerResponse

func NewRpcLocalRoomManagerResponse() *RpcLocalRoomManagerResponse

func (*RpcLocalRoomManagerResponse) GetRooms

func (res *RpcLocalRoomManagerResponse) GetRooms() []room.RemoteRoom

func (*RpcLocalRoomManagerResponse) SetRooms

func (res *RpcLocalRoomManagerResponse) SetRooms(rooms []room.Room)

Jump to

Keyboard shortcuts

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