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

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