Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrRoomRequired is returned when a subscribe/unsubscribe message omits // the room field. ErrRoomRequired = errors.New("room is required") // ErrRoomInvalid is returned when a room name does not satisfy the room // naming contract enforced by validateRoom. ErrRoomInvalid = errors.New("invalid room name") )
Functions ¶
Types ¶
type RoomProvider ¶
type RoomProvider interface {
Stream(ctx context.Context, room string) (<-chan protocol.StreamEvent, error)
}
RoomProvider supplies ordered per-subscriber event streams for rooms that back real-time data (for example execution event rooms). A provider-backed room delivers history plus live events to each subscriber independently, mirroring the SSE endpoint. Providers return a nil channel when they do not recognize the room.
type WebSocketHandler ¶
type WebSocketHandler struct {
// contains filtered or unexported fields
}
func NewWebSocketHandler ¶
func NewWebSocketHandler() *WebSocketHandler
func (*WebSocketHandler) HandleWebSocket ¶
func (s *WebSocketHandler) HandleWebSocket( w http.ResponseWriter, r *http.Request, )
HandleWebSocket upgrades a request to a WebSocket session.
Origin verification is left to the coder/websocket default, which rejects an Origin that does not match the request Host. Disabling it would let any page a user visits open an authenticated connection to the local daemon through their browser.
func (*WebSocketHandler) Hub ¶
func (s *WebSocketHandler) Hub() *Hub
func (*WebSocketHandler) SetRoomProvider ¶
func (s *WebSocketHandler) SetRoomProvider(provider RoomProvider)
SetRoomProvider registers the provider that backs streaming rooms. It must be called before the handler serves connections.