gorews

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2020 License: Apache-2.0 Imports: 5 Imported by: 1

README

gorews

A websocket client based on gorilla that supports auto reconnection

Documentation

Index

Constants

View Source
const ChanBufferSize = 64

Variables

This section is empty.

Functions

This section is empty.

Types

type GorewsClient

type GorewsClient struct {
	Incoming            chan []byte
	Outgoing            chan []byte
	OnConnectedCallback OnConnectedCallback

	Url       *url.URL
	ReqHeader http.Header
	Dialer    *websocket.Dialer
	// contains filtered or unexported fields
}

func NewGorewsClient

func NewGorewsClient(onConnectedCallback OnConnectedCallback) *GorewsClient

func (*GorewsClient) IsConnected

func (c *GorewsClient) IsConnected() bool

func (*GorewsClient) Start

func (c *GorewsClient) Start(urlStr string, reqHeader http.Header,
	handshakeTimeout time.Duration, writeTimeout time.Duration, readTimeout time.Duration) error

func (*GorewsClient) Stop

func (c *GorewsClient) Stop()

type OnConnectedCallback

type OnConnectedCallback func(*GorewsClient)

Jump to

Keyboard shortcuts

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