ws

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Type      string      `json:"type"`
	Data      interface{} `json:"data"`
	Timestamp time.Time   `json:"timestamp"`
}

Message represents a WebSocket message

type WebSocketHandler

type WebSocketHandler struct {
	// contains filtered or unexported fields
}

WebSocketHandler handles WebSocket connections

func NewWebSocketHandler

func NewWebSocketHandler() *WebSocketHandler

NewWebSocketHandler creates a new WebSocket handler

func (*WebSocketHandler) GetClientCount

func (h *WebSocketHandler) GetClientCount() int

GetClientCount returns the number of connected clients

func (*WebSocketHandler) HandleConnection

func (h *WebSocketHandler) HandleConnection(c *gin.Context)

HandleConnection upgrades HTTP connection to WebSocket @Summary Establish WebSocket connection @Description Upgrades HTTP connection to WebSocket for real-time communication @Tags WebSocket @Accept json @Produce json @Success 101 {string} string "WebSocket connection established" @Router /api/ws/connect [get]

Jump to

Keyboard shortcuts

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