websocket

package
v0.0.0-...-084a6c0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAX_EMIT_TIMEOUT = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type WebSocket

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

func NewWebSocket

func NewWebSocket(host string, options types.Options) *WebSocket

NewWebSocket instanciates a new webSocket connection object

func (*WebSocket) AddListener

func (ws *WebSocket) AddListener(event int, channel chan<- json.RawMessage)

Adds a listener to a Kuzzle global event. When an event is fired, listeners are called in the order of their insertion.

func (*WebSocket) CancelSubs

func (ws *WebSocket) CancelSubs()

func (*WebSocket) Close

func (ws *WebSocket) Close() error

func (*WebSocket) Connect

func (ws *WebSocket) Connect() (bool, error)

Connect connects to a kuzzle instance

func (*WebSocket) EmitEvent

func (ws *WebSocket) EmitEvent(event int, arg interface{})

Emit an event to all registered listeners

func (*WebSocket) Host

func (ws *WebSocket) Host() string

func (*WebSocket) IsReady

func (ws *WebSocket) IsReady() bool

func (*WebSocket) ListenerCount

func (ws *WebSocket) ListenerCount(event int) int

func (*WebSocket) Once

func (ws *WebSocket) Once(event int, channel chan<- json.RawMessage)

func (*WebSocket) Port

func (ws *WebSocket) Port() int

func (*WebSocket) RegisterSub

func (ws *WebSocket) RegisterSub(channel, roomID string, filters json.RawMessage, subscribeToSelf bool, notifChan chan<- types.NotificationResult, onReconnectChannel chan<- interface{})

func (*WebSocket) RemoveAllListeners

func (ws *WebSocket) RemoveAllListeners(event int)

Removes all listeners, either from all events and close channels

func (*WebSocket) RemoveListener

func (ws *WebSocket) RemoveListener(event int, c chan<- json.RawMessage)

Removes a listener from an event.

func (*WebSocket) RequestHistory

func (ws *WebSocket) RequestHistory() map[string]time.Time

func (*WebSocket) Send

func (ws *WebSocket) Send(query []byte, options types.QueryOptions, responseChannel chan<- *types.KuzzleResponse, requestId string) error

func (*WebSocket) SslConnection

func (ws *WebSocket) SslConnection() bool

func (*WebSocket) State

func (ws *WebSocket) State() int

func (*WebSocket) UnregisterSub

func (ws *WebSocket) UnregisterSub(roomID string)

Jump to

Keyboard shortcuts

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