Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UpgradeHandler ¶
func UpgradeHandler(hub *Hub) http.HandlerFunc
UpgradeHandler returns an http.HandlerFunc that upgrades the connection to WebSocket.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a middleman between the WebSocket connection and the hub.
type Event ¶
type Event struct {
TenantID string // target tenant; required
Type string // e.g. "balance_updated", "income_received", "snapshot_ready"
Payload string // pre-rendered HTML fragment with hx-swap-oob attribute
}
Event represents a push notification to be delivered to browser clients.
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub maintains the set of active clients and broadcasts messages to them.
type InProcessPublisher ¶
type InProcessPublisher struct {
// contains filtered or unexported fields
}
InProcessPublisher is a basic implementation of Publisher that forwards events to the Hub.
func NewInProcessPublisher ¶
func NewInProcessPublisher(hub *Hub) *InProcessPublisher
NewInProcessPublisher creates a new InProcessPublisher.
Click to show internal directories.
Click to hide internal directories.