Documentation
¶
Index ¶
Constants ¶
View Source
const ( OpContinuation = 0x0 OpText = 0x1 OpBinary = 0x2 OpClose = 0x8 OpPing = 0x9 OpPong = 0xA )
Variables ¶
View Source
var ErrClosed = errors.New("websocket closed")
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn represents a websocket connection.
func Upgrade ¶
func Upgrade(ctx *bebo.Context, options WebSocketOptions) (*Conn, error)
Upgrade upgrades the request to a WebSocket connection.
func (*Conn) ReadMessage ¶
ReadMessage reads the next non-control frame.
func (*Conn) WriteMessage ¶
WriteMessage writes a websocket frame.
type SSE ¶
type SSE struct {
// contains filtered or unexported fields
}
SSE represents an active SSE stream.
func StartSSE ¶
func StartSSE(ctx *bebo.Context, options SSEOptions) (*SSE, error)
StartSSE configures response headers and returns an SSE stream.
func (*SSE) Send ¶
func (s *SSE) Send(msg SSEMessage) error
Send writes an SSE message and flushes the response.
type SSEMessage ¶
SSEMessage is an SSE payload.
type SSEOptions ¶
SSEOptions configures server-sent events.
Click to show internal directories.
Click to hide internal directories.