client

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2018 License: MIT Imports: 14 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 {
	Connected bool

	IncomingMsgChan chan *message.Message
	// contains filtered or unexported fields
}

Client struct

func New

func New(logLevel logrus.Level, requestTimeout ...time.Duration) *Client

New returns a new client

func (*Client) ConnectTo

func (c *Client) ConnectTo(addr string) error

ConnectTo connects to the server at addr, for now the only supported protocol is tcp this methods blocks as it also handles the messages from the server

func (*Client) Disconnect

func (c *Client) Disconnect()

Disconnect disconnects the client

func (*Client) SendNotify

func (c *Client) SendNotify(route string, data []byte) error

SendNotify sends a notify to the server

func (*Client) SendRequest

func (c *Client) SendRequest(route string, data []byte) (uint, error)

SendRequest sends a request to the server

type HandshakeData

type HandshakeData struct {
	Code int          `json:"code"`
	Sys  HandshakeSys `json:"sys"`
}

HandshakeData struct

type HandshakeSys

type HandshakeSys struct {
	Dict       map[string]uint16 `json:"dict"`
	Heartbeat  int               `json:"heartbeat"`
	Serializer string            `json:"serializer"`
}

HandshakeSys struct

Jump to

Keyboard shortcuts

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