Documentation
¶
Overview ¶
ssemanager.go
sseutils.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ConsoleStreamManager = NewSSEManager(config.MaxSSEConnections, config.SSEMessageBufferSize) EventStreamManager = NewSSEManager(config.MaxSSEConnections, config.SSEMessageBufferSize) )
Global managers for console and event streams
Functions ¶
func BroadcastConsoleOutput ¶
func BroadcastConsoleOutput(message string)
BroadcastConsoleOutput sends log to all connected console log clients
func BroadcastDetectionEvent ¶
func BroadcastDetectionEvent(message string)
BroadcastDetectionEvent sends an event to all connected clients
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a connected SSE client
type SSEManager ¶
type SSEManager struct {
// contains filtered or unexported fields
}
SSEManager manages Server-Sent Event streams
func NewSSEManager ¶
func NewSSEManager(maxClients, maxBuffer int) *SSEManager
NewSSEManager creates a new SSE stream manager
func (*SSEManager) AddInternalSubscriber ¶
func (m *SSEManager) AddInternalSubscriber() chan string
func (*SSEManager) Broadcast ¶
func (m *SSEManager) Broadcast(message string)
Broadcast sends a message to all clients with a non-blocking approach
func (*SSEManager) CreateStreamHandler ¶
func (m *SSEManager) CreateStreamHandler(streamType string) http.HandlerFunc
CreateStreamHandler creates an HTTP handler for SSE streaming
Click to show internal directories.
Click to hide internal directories.