Documentation ¶
Index ¶
- type Callback
- type Connector
- func (c *Connector) Close()
- func (c *Connector) Connected(cb func())
- func (c *Connector) InitHandshakeACK(heartbeatDuration int) error
- func (c *Connector) InitReqHandshake(version, hType string, rsa, userData map[string]interface{}) error
- func (c *Connector) IsClosed() bool
- func (c *Connector) Notify(route string, data []byte) error
- func (c *Connector) On(event string, callback Callback)
- func (c *Connector) Request(route string, data []byte, callback Callback) error
- func (c *Connector) Run(addr string, ws bool, tickrate int64) error
- func (c *Connector) SetHandshake(handshake interface{}) error
- func (c *Connector) SetHandshakeAck(handshakeAck interface{}) error
- func (c *Connector) SetHeartBeat(heartbeat interface{}) error
- type DefaultHandshakePacket
- type HandshakeOpts
- type HeartbeatSysOpts
- type SysOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Callback ¶
type Callback func(data []byte)
Callback represents the callback type which will be called when the correspond events is occurred.
type Connector ¶
Connector is a Pomelo [nano] client
func (*Connector) Close ¶
func (c *Connector) Close()
Close close the connection, and shutdown the benchmark
func (*Connector) InitHandshakeACK ¶
InitHandshakeACK --
func (*Connector) InitReqHandshake ¶
func (c *Connector) InitReqHandshake(version, hType string, rsa, userData map[string]interface{}) error
InitReqHandshake --
func (*Connector) Request ¶
Request send a request to server and register a callbck for the response
func (*Connector) SetHandshake ¶
SetHandshake --
func (*Connector) SetHandshakeAck ¶
SetHandshakeAck --
func (*Connector) SetHeartBeat ¶
SetHeartBeat --
type DefaultHandshakePacket ¶
type DefaultHandshakePacket struct { Code int `json:"code"` Sys HeartbeatSysOpts `json:"sys"` }
DefaultACK --
type HandshakeOpts ¶
type HandshakeOpts struct { Sys SysOpts `json:"sys"` UserData map[string]interface{} `json:"user"` }
HandshakeOpts --
type HeartbeatSysOpts ¶
type HeartbeatSysOpts struct {
Heartbeat int `json:"heartbeat"`
}
HeartbeatSysOpts --
Click to show internal directories.
Click to hide internal directories.