Documentation ¶
Index ¶
- type Client
- func (c *Client) ConnectTo(addr string) error
- func (c *Client) ConnectToTLS(addr string, skipVerify bool) error
- func (c *Client) ConnectedStatus() bool
- func (c *Client) Disconnect()
- func (c *Client) MsgChannel() chan *message.Message
- func (c *Client) SendNotify(route string, data []byte) error
- func (c *Client) SendRequest(route string, data []byte) (uint, error)
- type Command
- type HandshakeData
- type HandshakeSys
- type PitayaClient
- type ProtoBufferInfo
- type ProtoClient
- func (pc *ProtoClient) AddPushResponse(route string, protoName string)
- func (pc *ProtoClient) ConnectTo(addr string) error
- func (pc *ProtoClient) ConnectToTLS(addr string, skipVerify bool) error
- func (pc *ProtoClient) Disconnect()
- func (pc *ProtoClient) ExportInformation() *ProtoBufferInfo
- func (pc *ProtoClient) LoadInfo(info *ProtoBufferInfo) error
- func (pc *ProtoClient) LoadServerInfo(addr string) error
- func (pc *ProtoClient) MsgChannel() chan *message.Message
- func (pc *ProtoClient) SendNotify(route string, data []byte) error
- func (pc *ProtoClient) SendRequest(route string, data []byte) (uint, error)
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 (*Client) ConnectTo ¶
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) ConnectToTLS ¶ added in v0.7.6
ConnectToTLS connects to the server at addr using TLS, for now the only supported protocol is tcp this methods blocks as it also handles the messages from the server
func (*Client) ConnectedStatus ¶ added in v0.7.6
ConnectedStatus return the connection status
func (*Client) MsgChannel ¶ added in v0.7.6
MsgChannel return the incoming message channel
func (*Client) SendNotify ¶
SendNotify sends a notify to the server
type Command ¶ added in v0.7.6
type Command struct {
// contains filtered or unexported fields
}
Command struct. Save the input and output type and proto descriptor for each one.
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
type PitayaClient ¶ added in v0.7.6
type ProtoBufferInfo ¶ added in v0.7.6
ProtoBufferInfo save all commands from a server.
type ProtoClient ¶ added in v0.7.6
type ProtoClient struct { Client IncomingMsgChan chan *message.Message // contains filtered or unexported fields }
ProtoClient struct
func NewProto ¶ added in v0.7.6
func NewProto(docsRoute string, docslogLevel logrus.Level, requestTimeout ...time.Duration) *ProtoClient
NewProto returns a new protoclient with the auto documentation route.
func NewWithDescriptor ¶ added in v0.7.6
func NewWithDescriptor(descriptorsRoute string, docsRoute string, docslogLevel logrus.Level, requestTimeout ...time.Duration) *ProtoClient
NewWithDescriptor returns a new protoclient with the descriptors route and auto documentation route.
func (*ProtoClient) AddPushResponse ¶ added in v0.7.6
func (pc *ProtoClient) AddPushResponse(route string, protoName string)
AddPushResponse add a push response. Must be ladded before LoadInfo.
func (*ProtoClient) ConnectTo ¶ added in v0.7.6
func (pc *ProtoClient) 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 (*ProtoClient) ConnectToTLS ¶ added in v0.7.6
func (pc *ProtoClient) ConnectToTLS(addr string, skipVerify bool) error
ConnectToTLS connects to the server at addr using TLS, for now the only supported protocol is tcp this methods blocks as it also handles the messages from the server
func (*ProtoClient) Disconnect ¶ added in v0.7.6
func (pc *ProtoClient) Disconnect()
Disconnect the client
func (*ProtoClient) ExportInformation ¶ added in v0.7.6
func (pc *ProtoClient) ExportInformation() *ProtoBufferInfo
ExportInformation export supported server commands information
func (*ProtoClient) LoadInfo ¶ added in v0.7.6
func (pc *ProtoClient) LoadInfo(info *ProtoBufferInfo) error
LoadInfo load commands information form ProtoBufferInfo
func (*ProtoClient) LoadServerInfo ¶ added in v0.7.6
func (pc *ProtoClient) LoadServerInfo(addr string) error
LoadServerInfo load commands information from the server. Addr is the server address.
func (*ProtoClient) MsgChannel ¶ added in v0.7.6
func (pc *ProtoClient) MsgChannel() chan *message.Message
MsgChannel return the incoming message channel
func (*ProtoClient) SendNotify ¶ added in v0.7.6
func (pc *ProtoClient) SendNotify(route string, data []byte) error
SendNotify sends a notify to the server
func (*ProtoClient) SendRequest ¶ added in v0.7.6
func (pc *ProtoClient) SendRequest(route string, data []byte) (uint, error)
SendRequest sends a request to the server