websocket

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: Apache-2.0 Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultOptions = &Options{
	OpCode:   ws.OpText,
	Dialer:   ws.DefaultDialer,
	Upgrader: ws.DefaultHTTPUpgrader,
	ServeMux: http.DefaultServeMux,
	Backlog:  128,
}

DefaultOptions default websocket options

Functions

func New

func New() transport.Factory

New websocket transport factory

func WithOptions

func WithOptions(option *Options) transport.Option

WithOptions to wrap the websocket options

Types

type Options

type Options struct {
	Cert            string          `json:"cert"`
	Key             string          `json:"key"`
	OpCode          ws.OpCode       `json:"opCode"`
	Routers         []string        `json:"routers"`
	CheckUTF8       bool            `json:"checkUTF8"`
	MaxFrameSize    int64           `json:"maxFrameSize"`
	ReadBufferSize  int             `json:"readBufferSize"`
	WriteBufferSize int             `json:"writeBufferSize"`
	Backlog         int             `json:"backlog"`
	Dialer          ws.Dialer       `json:"-"`
	Upgrader        ws.HTTPUpgrader `json:"-"`
	ServeMux        *http.ServeMux  `json:"-"`
}

Options to define the websocket

func FromContext

func FromContext(ctx context.Context, def *Options) *Options

FromContext to unwrap the websocket options

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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