Documentation ¶
Index ¶
- func ExecuteCommand(w http.ResponseWriter, r *http.Request)
- type ChatController
- func (cc *ChatController) CreateRoom(c *gin.Context)
- func (cc *ChatController) GetChatHistory(c *gin.Context)
- func (cc *ChatController) GetRooms(c *gin.Context)
- func (cc *ChatController) JoinRoom(c *gin.Context)
- func (cc *ChatController) LeaveRoom(c *gin.Context)
- func (cc *ChatController) SendChatMessage(c *gin.Context)
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.
Click to show internal directories.
Click to hide internal directories.