websocket

package
v2.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Websocket

type Websocket interface {
	OnConnect(cb func())
	ConnectContext(ctx context.Context, addr string, headers http.Header) error
	ConnectWithRetry(parentCtx context.Context, addr string, headers http.Header)
	Wait()
	Read() <-chan []byte
	// WriteJSON writes interface{} encoded as JSON to our connection
	WriteJSON(v interface{}) error
	WriteMessage(messageType int, data []byte) error
	SetTLSConfig(c *tls.Config)
}

Websocket implements a websocket client.

func New

func New() Websocket

New creates a new Websocket.

Jump to

Keyboard shortcuts

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