room_old

package
v0.0.0-...-2254657 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EndRoom

func EndRoom(roomId misc.RoomId)

func GetGlobalLobby

func GetGlobalLobby(logger *slog.Logger) misc.RoomId

func Join

func Join(roomId misc.RoomId, listenerId misc.ListenerId, handler pubsub.TopicMessageHandler)

func Leave

func Leave(roomId misc.RoomId, listenerId misc.ListenerId)

func LeaveAllRooms

func LeaveAllRooms(listenerId misc.ListenerId)

func RemoveAllRooms

func RemoveAllRooms()

func Send

func Send(msg message.Message)

Types

type Room

type Room struct {
	RoomId misc.RoomId
	// contains filtered or unexported fields
}

func FindRoom

func FindRoom(roomId misc.RoomId) *Room

func NewRoom

func NewRoom(baseLogger *slog.Logger, name string, adminScript string) (*Room, error)

func NewRoomWithId

func NewRoomWithId(baseLogger *slog.Logger, roomId misc.RoomId, name string, adminScript string) (*Room, error)

func (*Room) HasListener

func (r *Room) HasListener(listenerId misc.ListenerId) bool

func (*Room) JSTemplate

func (r *Room) JSTemplate(isolate *v8go.Isolate) *v8go.ObjectTemplate

func (*Room) Leave

func (r *Room) Leave(id misc.ListenerId) error

func (*Room) OnMessageFromTopic

func (r *Room) OnMessageFromTopic(msg message.Message)

func (*Room) Send

func (r *Room) Send(msg message.Message) error

type RoomListener

type RoomListener interface {
	OnMessage(msg message.Message)
}

Listen for messages in the room

Jump to

Keyboard shortcuts

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