websocket

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

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

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"`
	Binary   bool            `json:"binary,string"`
	Routers  []string        `json:"routers"`
	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

Jump to

Keyboard shortcuts

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