ws

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 21, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

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

Channel wraps a websocket connection.

func NewWebsocketChannel

func NewWebsocketChannel(config Config) (*Channel, error)

NewWebsocketChannel creates a new channel to send and receive messages over the websocket.

func (*Channel) ReadChannel

func (c *Channel) ReadChannel() chan []byte

ReadChannel returns a channel to read from the websocket connection

func (*Channel) Send

func (c *Channel) Send(msg []byte) error

Send sends a mesage over the websocket connection

type Config

type Config struct {
	ConnectRetryWaitDuration time.Duration
	SendReceiveBufferSize    int
	URL                      string
}

Config containers the configuratinos for the websocket channel

type Interface

type Interface interface {
	Send(req []byte) error
	ReadChannel() chan []byte
	Closed() chan int
}

Interface exposes the websocket interface

Jump to

Keyboard shortcuts

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