repository

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(address string) *roomsRepository

Types

type RoomsRepository

type RoomsRepository interface {
	/*
	   events.go functions
	*/
	PublishEvent(ctx context.Context, event model.Event) error
	SubscribeToEvents(ctx context.Context, eventHandler func(event model.Event)) error

	/*
	   rooms.go functions
	*/
	InsertRoom(ctx context.Context, room *model.Room) error
	UpdateRoom(ctx context.Context, id string, name string, hostId string, maxPlayers uint32, questionCount uint32, status model.RoomStatus) error
	UpdateRoomStatus(ctx context.Context, id string, status model.RoomStatus) error
	GetRoomById(ctx context.Context, id string) (*model.Room, error)

	/*
	   users.go functions
	*/
	InsertUserInRoom(ctx context.Context, userId string, roomId string) error
	RemoveUserFromRoom(ctx context.Context, userId string, roomId string) error
	GetRoomPlayersCount(ctx context.Context, id string) (uint32, error)

	/*
	   questions.go functions
	*/
	GetQuestionCount(ctx context.Context, roomId string) (int, error)
}

Jump to

Keyboard shortcuts

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