client

package
v0.0.0-...-0f0b338 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	URL             string
	Protocol        interfaces.Protocol
	ConnectionState interfaces.ConnectionState
}

Client represents a connection to a deepstream.io server

func New

func New(url string, protocolOrNil ...interfaces.Protocol) (*Client, error)

New creates a new client

func (*Client) Close

func (c *Client) Close() error

Close connection to deepstream.io server

func (*Client) Connect

func (c *Client) Connect() error

Connect with deepstream.io server

func (*Client) Error

func (c *Client) Error(err error) error

Error handlers errors in client

func (*Client) Login

func (c *Client) Login(authParams map[string]interface{}) error

Login with deepstream.io server

type WebsocketProtocol

type WebsocketProtocol struct {
	URL    string
	Client *websocket.Conn
}

WebsocketProtocol is the default protocol for deepstream.io

func NewWebsocketProtocol

func NewWebsocketProtocol(url string) (*WebsocketProtocol, error)

NewWebsocketProtocol creates a new instance

func (*WebsocketProtocol) Close

func (w *WebsocketProtocol) Close() error

Close websocket connection

func (*WebsocketProtocol) Connect

func (w *WebsocketProtocol) Connect() error

Connect to deepstream.io

func (*WebsocketProtocol) RecvActions

func (w *WebsocketProtocol) RecvActions() ([]interfaces.Action, error)

RecvActions receives actions from the websocket stream

func (*WebsocketProtocol) SendAction

func (w *WebsocketProtocol) SendAction(action interfaces.Action) error

SendAction writes an action in the websocket stream

Jump to

Keyboard shortcuts

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