ssestream

package
v5.3.2-beta Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

ssemanager.go

sseutils.go

Index

Constants

This section is empty.

Variables

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

Jump to

Keyboard shortcuts

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