server

package
v0.0.0-...-7ad1348 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 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 WebSocketClient

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

WebSocketClient represents a WebSocket client

type WebSocketManager

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

WebSocketManager manages WebSocket connections

func NewWebSocketManager

func NewWebSocketManager() *WebSocketManager

NewWebSocketManager creates a new WebSocketManager

func (*WebSocketManager) BroadcastToAll

func (m *WebSocketManager) BroadcastToAll(message []byte)

BroadcastToAll sends a message to all clients

func (*WebSocketManager) BroadcastToFlow

func (m *WebSocketManager) BroadcastToFlow(flowID string, message []byte)

BroadcastToFlow sends a message to all clients subscribed to a flow

func (*WebSocketManager) HandleWebSocket

func (m *WebSocketManager) HandleWebSocket(w http.ResponseWriter, r *http.Request)

HandleWebSocket handles WebSocket connections

func (*WebSocketManager) Run

func (m *WebSocketManager) Run()

Run starts the WebSocketManager

type WebSocketMessage

type WebSocketMessage struct {
	Type    string          `json:"type"`
	Payload json.RawMessage `json:"payload"`
}

WebSocketMessage represents a message sent over WebSocket

Jump to

Keyboard shortcuts

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