Documentation ¶
Index ¶
- func SetClientHeaders(headers http.Header, options ...Option)
- type CompressionMode
- type CompressionOptions
- type Conn
- func (obj *Conn) Close(reasons ...string) error
- func (obj *Conn) Conn() *websocket.Conn
- func (obj *Conn) Option() Option
- func (obj *Conn) Ping(ctx context.Context) error
- func (obj *Conn) Read(p []byte) (n int, err error)
- func (obj *Conn) Recv(ctx context.Context) (MessageType, []byte, error)
- func (obj *Conn) RecvJson(ctx context.Context, v any) error
- func (obj *Conn) Rwc() io.ReadWriteCloser
- func (obj *Conn) Send(ctx context.Context, typ MessageType, p any) error
- func (obj *Conn) SendJson(ctx context.Context, v any) error
- func (obj *Conn) SetReadLimit(n int64)
- func (obj *Conn) Write(p []byte) (n int, err error)
- type MessageType
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetClientHeaders ¶
Types ¶
type CompressionMode ¶
type CompressionMode = websocket.CompressionMode
const ( // MessageText is for UTF-8 encoded text messages like JSON. MessageText websocket.MessageType = websocket.MessageText // MessageBinary is for binary messages like protobufs. MessageBinary websocket.MessageType = websocket.MessageBinary CompressionContextTakeover CompressionMode = websocket.CompressionContextTakeover CompressionDisabled CompressionMode = websocket.CompressionDisabled CompressionNoContextTakeover CompressionMode = websocket.CompressionNoContextTakeover )
type CompressionOptions ¶
type CompressionOptions = compressionOptions
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func NewServerConn ¶
func (*Conn) Rwc ¶
func (obj *Conn) Rwc() io.ReadWriteCloser
func (*Conn) SetReadLimit ¶
type MessageType ¶
type MessageType = websocket.MessageType
type Option ¶
type Option struct { Subprotocols []string // Subprotocols lists the WebSocket subprotocols to negotiate with the server. CompressionMode CompressionMode // CompressionMode controls the compression mode. CompressionThreshold int // CompressionThreshold controls the minimum size of a message before compression is applied ,Defaults to 512 bytes for CompressionNoContextTakeover and 128 bytes for CompressionContextTakeover. CompressionOptions *compressionOptions }
func (*Option) Extensions ¶
Click to show internal directories.
Click to hide internal directories.