services

package
v0.0.0-...-0e07719 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRoom

func CreateRoom(w http.ResponseWriter, r *http.Request, database *sql.DB)

func GetHost

func GetHost(w http.ResponseWriter, r *http.Request, database *sql.DB)

func GetRoomById

func GetRoomById(w http.ResponseWriter, r *http.Request, database *sql.DB)

func GetUser

func GetUser(w http.ResponseWriter, r *http.Request, database *sql.DB)

func LoginHost

func LoginHost(w http.ResponseWriter, r *http.Request, database *sql.DB)

func LoginUser

func LoginUser(w http.ResponseWriter, r *http.Request, database *sql.DB)

func RegisterHost

func RegisterHost(w http.ResponseWriter, r *http.Request, database *sql.DB)

func RegisterUser

func RegisterUser(w http.ResponseWriter, r *http.Request, database *sql.DB)

Types

type RoomSessionService

type RoomSessionService struct {
	RoomRepo *repositories.RoomRepository
	// contains filtered or unexported fields
}

func NewRoomSessionService

func NewRoomSessionService(
	roomSessionManager *eventbroker.RoomSessionManager,
	roomRepository *repositories.RoomRepository,
) *RoomSessionService

func (*RoomSessionService) GetOrCreateRoomSession

func (r *RoomSessionService) GetOrCreateRoomSession(context context.Context, roomId string, roomPassword string) (*models.RoomSession, error)

Creates or retrieves the roomSession stored, or save in memory if it doesn't exist yet

func (*RoomSessionService) JoinUserToRoomSession

func (r *RoomSessionService) JoinUserToRoomSession(roomSession *models.RoomSession, user *models.User, conn *websocket.Conn) error

Subscribe user to any events in a specific room

Jump to

Keyboard shortcuts

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