wswrapper

package
v0.0.0-...-5e2eff2 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 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 WSWrapper

type WSWrapper struct {
	DisableTLSVerification bool
	Endpoint               string
	Headers                http.Header
	MaximumDropoutTime     time.Duration
	// contains filtered or unexported fields
}

The WSWrapper adds a buffer layer to the underlying websocket connection It gracefully handles connection dropouts/reconnects in a manner that is transparent to the handler

func (*WSWrapper) ReadJSON

func (w *WSWrapper) ReadJSON(v interface{}) error

func (*WSWrapper) Run

func (w *WSWrapper) Run(notifyFirstConn *sync.Cond) error

func (*WSWrapper) Setup

func (w *WSWrapper) Setup()

func (*WSWrapper) WriteJSON

func (w *WSWrapper) WriteJSON(v interface{}) error

func (*WSWrapper) WriteJSONUnbuffered

func (w *WSWrapper) WriteJSONUnbuffered(v interface{}) error

For heartbeats, as there's no reason to buffer them

Jump to

Keyboard shortcuts

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