websocket

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrConnectionNotEstablished is returned by methods that need a connection
	// but no connection is already created.
	ErrConnectionNotEstablished = errors.New("connection has not yet been established")
)

Functions

This section is empty.

Types

type ManagedConnection

type ManagedConnection struct {
	// contains filtered or unexported fields
}

ManagedConnection represents a websocket connection.

func NewDurableSendingConnection

func NewDurableSendingConnection(target string) *ManagedConnection

NewDurableSendingConnection creates a new websocket connection that can only send messages to the endpoint it connects to. The connection will continuously be kept alive and reconnected in case of a loss of connectivity.

func (*ManagedConnection) Close

func (c *ManagedConnection) Close() error

Close closes the websocket connection.

func (*ManagedConnection) Send

func (c *ManagedConnection) Send(msg interface{}) error

Send sends an encodable message over the websocket connection.

Jump to

Keyboard shortcuts

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