gorilla

package
v0.0.0-...-a663fdf Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RequestIDLength size of id sent on WS request
	RequestIDLength = 16
	// CloseMessageCode identifier the message id for a close request
	CloseMessageCode = 1000
	// DefaultTimeout timeout in seconds
	DefaultTimeout = 30
)

Variables

View Source
var (
	ErrIDInUse           = errors.New("id already in use")
	ErrTimeout           = errors.New("timeout")
	ErrInvalidResponseID = errors.New("invalid response id")
)

Functions

This section is empty.

Types

type Option

type Option func(ws *WebSocket) error

type WebSocket

type WebSocket struct {
	Conn *gorilla.Conn

	Timeout time.Duration
	Option  []Option
	// contains filtered or unexported fields
}

func Create

func Create() *WebSocket

func (*WebSocket) Close

func (ws *WebSocket) Close() error

func (*WebSocket) Connect

func (ws *WebSocket) Connect(url string) (conn.Connection, error)

func (*WebSocket) LiveNotifications

func (ws *WebSocket) LiveNotifications(liveQueryID string) (chan model.Notification, error)

func (*WebSocket) Logger

func (ws *WebSocket) Logger(logData logger.Logger) *WebSocket

If path is empty it will use os.stdout/os.stderr

func (*WebSocket) RawLogger

func (ws *WebSocket) RawLogger(logData logger.Logger) *WebSocket

func (*WebSocket) Send

func (ws *WebSocket) Send(method string, params []interface{}) (interface{}, error)

func (*WebSocket) SetCompression

func (ws *WebSocket) SetCompression(compress bool) *WebSocket

func (*WebSocket) SetTimeOut

func (ws *WebSocket) SetTimeOut(timeout time.Duration) *WebSocket

Jump to

Keyboard shortcuts

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