wsconn

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WsClient

type WsClient struct {
	WsClientOpt

	sync.Mutex
	// contains filtered or unexported fields
}

func NewWsClient

func NewWsClient(opt WsClientOpt) (*WsClient, error)

func (*WsClient) Close

func (c *WsClient) Close() error

func (*WsClient) Request

func (c *WsClient) Request(method string, req interface{}) (protoo.Message, error)

type WsClientOpt

type WsClientOpt struct {
	Addr        string
	Path        string
	QueryFields map[string]string
}

type WsServer

type WsServer struct {
	WsServerOpt
	// contains filtered or unexported fields
}

func NewWsServer

func NewWsServer(opt WsServerOpt) (*WsServer, error)

func (*WsServer) Start

func (w *WsServer) Start()

type WsServerOpt

type WsServerOpt struct {
	PingInterval   time.Duration
	PongWait       time.Duration
	Conn           *websocket.Conn
	RequestHandler func(message protoo.Message) *protoo.Message
}

Jump to

Keyboard shortcuts

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