sse

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: May 25, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComponentRenderer

type ComponentRenderer func(componentID string, data interface{}) (string, error)

ComponentRenderer is a function that renders a component to HTML

type SSEHandler

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

SSEHandler handles Server-Sent Events connections

func NewSSEHandler

func NewSSEHandler(events events.EventManager, logger *zerolog.Logger) *SSEHandler

NewSSEHandler creates a new SSE handler

func (*SSEHandler) RegisterRenderer

func (h *SSEHandler) RegisterRenderer(eventType string, renderer ComponentRenderer)

RegisterRenderer registers a component renderer for a specific event type

func (*SSEHandler) ServeHTTP

func (h *SSEHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler

Jump to

Keyboard shortcuts

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