Documentation
¶
Overview ¶
Package wsclient defines a websocket client and interface
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn interface { Close() error SetReadDeadline(time.Time) error ReadMessage() (int, []byte, error) WriteMessage(int, []byte) error }
Conn is the interface for a *websocket.Conn as used in this wrapper package
type Dialer ¶
Dialer is the interface for a *websocket.Dialer as used in this wrapper package
func WrapDialer ¶
WrapDialer will wrap a *websocket.Dialer so it conforms to this package's interface
type Logger ¶
type Logger = interface { Log(keyvals ...interface{}) error Message(string, ...interface{}) Err(string, error, ...interface{}) Printf(string, ...interface{}) }
Logger is the interface expected for logging
type Options ¶
type Options struct {
MaxConcurrentHandlers int
}
Options enables setting up a WSClient with the desired connection settings
type WSClient ¶
type WSClient struct {
// contains filtered or unexported fields
}
WSClient is a websocket client. It should be instantiated by NewWSClient
func NewWSClient ¶
NewWSClient creates a new WSClient
func (*WSClient) HandleRequests ¶
HandleRequests starts various goroutines to read and write to the websocket
func (*WSClient) SendMessage ¶
SendMessage queues a message to be sent to the websocket