websocket

package
v0.2.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Type    int
	Payload []byte
}

type MessageClient

type MessageClient struct {
	*app.MessageClientInfo
	// contains filtered or unexported fields
}

func NewMessageClient

func NewMessageClient(ctx *fasthttp.RequestCtx, opts ...MessageClientOption) *MessageClient

func (*MessageClient) Close

func (client *MessageClient) Close() error

Close implements app.MessageSource.

func (*MessageClient) RegisterCloseHandler

func (client *MessageClient) RegisterCloseHandler(proc func(app.MessageClient))

RegisterCloseHandler implements app.MessageClient.

func (*MessageClient) Send

func (client *MessageClient) Send(format app.MessageFormat, payload []byte) error

Send implements app.MessageSource.

func (*MessageClient) Start

func (client *MessageClient) Start(pipe *app.MessagePipe)

Start implements app.MessageSource.

func (*MessageClient) Stop

func (client *MessageClient) Stop()

Stop implements app.MessageSource.

type MessageClientOption

type MessageClientOption interface {
	// contains filtered or unexported methods
}

func WithCheckOrigin

func WithCheckOrigin(predicate func(ctx *fasthttp.RequestCtx) bool) MessageClientOption

func WithEnableCompression

func WithEnableCompression(enabled bool) MessageClientOption

func WithError

func WithError(action func(ctx *fasthttp.RequestCtx, status int, reason error)) MessageClientOption

func WithHandshakeTimeout

func WithHandshakeTimeout(timeout time.Duration) MessageClientOption

func WithReadBufferSize

func WithReadBufferSize(size int) MessageClientOption

func WithSubprotocols

func WithSubprotocols(v []string) MessageClientOption

func WithWriteBufferPool

func WithWriteBufferPool(pool websocket.BufferPool) MessageClientOption

func WithWriteBufferSize

func WithWriteBufferSize(size int) MessageClientOption

type MessageClientOptionFunc

type MessageClientOptionFunc func(*websocket.FastHTTPUpgrader)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL