wsclient

package
Version: v0.0.0-...-5e9c0d7 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPreparedTextMessage

func NewPreparedTextMessage(msg []byte) (*gorilla.PreparedMessage, error)

Types

type Client

type Client struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func New

func New(scheme, host, port string, keepAlive bool, keepAliveTimeout time.Duration, log logrus.FieldLogger) *Client

func (*Client) ConnectAndListen

func (c *Client) ConnectAndListen(path string, header http.Header, handler HandlerFunc) error

func (*Client) Stop

func (c *Client) Stop()

func (*Client) WriteMsg

func (c *Client) WriteMsg(msg *gorilla.PreparedMessage, errHandler ErrHandler) error

type ErrHandler

type ErrHandler = func(error)

type HandlerFunc

type HandlerFunc = func(messageType int, p []byte, err error)

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL