wsclient

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WebSocketClient

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

WebSocketClient defines websocket client object

func NewWebSocketClient

func NewWebSocketClient(conf *WebSocketConfig) *WebSocketClient

NewWebSocketClient returns a new web socket client object with its configuration

func (*WebSocketClient) Init

func (wcc *WebSocketClient) Init() error

Init initializes websocket client

func (*WebSocketClient) Notify

func (wcc *WebSocketClient) Notify(authInfo map[string]string)

Notify logs info

func (*WebSocketClient) Receive

func (wcc *WebSocketClient) Receive() (model.Message, error)

Receive reads the binary message through the connection

func (*WebSocketClient) Send

func (wcc *WebSocketClient) Send(message model.Message) error

Send sends the message as binary message through the connection

func (*WebSocketClient) Uninit

func (wcc *WebSocketClient) Uninit()

Uninit closes the web socket connection

type WebSocketConfig

type WebSocketConfig struct {
	URL              string
	CertFilePath     string
	KeyFilePath      string
	HandshakeTimeout time.Duration
	ReadDeadline     time.Duration
	WriteDeadline    time.Duration
	ExtendHeader     http.Header
}

WebSocketConfig defines configuration object

Jump to

Keyboard shortcuts

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