controllers

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

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteCommand

func ExecuteCommand(w http.ResponseWriter, r *http.Request)

ExecuteCommand handles WebSocket connections and executes commands

Types

type ChatController

type ChatController struct {
	TCPTransport *network.TCPTransport // Reference to the TCPTransport instance
	ChatService  *chat.ChatService     // Reference to the ChatService instance
}

ChatController represents the controller for chat-related endpoints.

func NewChatController

func NewChatController(transport *network.TCPTransport, chatService *chat.ChatService) *ChatController

NewChatController creates a new instance of ChatController.

func (*ChatController) CreateRoom

func (cc *ChatController) CreateRoom(c *gin.Context)

CreateRoom handles the creation of a new chat room.

func (*ChatController) GetChatHistory

func (cc *ChatController) GetChatHistory(c *gin.Context)

func (*ChatController) GetRooms

func (cc *ChatController) GetRooms(c *gin.Context)

func (*ChatController) JoinRoom

func (cc *ChatController) JoinRoom(c *gin.Context)

JoinRoom handles a peer joining an existing chat room.

func (*ChatController) LeaveRoom

func (cc *ChatController) LeaveRoom(c *gin.Context)

LeaveRoom handles a peer leaving a chat room. Update the LeaveRoom function to properly extract the peer ID from the request parameters.

func (*ChatController) SendChatMessage

func (cc *ChatController) SendChatMessage(c *gin.Context)

SendChatMessage handles sending a chat message to a room.

Jump to

Keyboard shortcuts

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