Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterRoutes ¶
func RegisterRoutes(e *echo.Echo, broker *Broker, authMiddleware *auth.Middleware)
Types ¶
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
Broker fans out events to all subscribed SSE connections.
func (*Broker) Publish ¶
Publish sends an event to all subscribers. Slow subscribers that have a full buffer will have this event dropped (non-blocking send).
func (*Broker) Subscribe ¶
Subscribe returns a channel that receives all future published events. The caller must call Unsubscribe when done.
func (*Broker) Unsubscribe ¶
Unsubscribe removes a subscriber channel and closes it.
type Event ¶
Event represents a server-sent event with a named type and JSON data.
Click to show internal directories.
Click to hide internal directories.