Documentation ¶
Index ¶
- Variables
- func ByteToInt(b []byte) int
- func Encode(msgObj interface{}) ([]byte, error)
- func IntToBytes(n int64, b byte) ([]byte, error)
- type Client
- func (c *Client) Address() string
- func (c *Client) Close()
- func (c *Client) Handle(msgId MsgID, data []byte, conn net.Conn)
- func (c *Client) HeartBeatTime() time.Duration
- func (c *Client) Id() string
- func (c *Client) IsConnected() bool
- func (c *Client) IsReconnecting() bool
- func (c *Client) OnClose(f func(c *Client)) *Client
- func (c *Client) OnConnected(f func(c *Client)) *Client
- func (c *Client) OnConnecting(f func(c *Client)) *Client
- func (c *Client) OnDisconnect(f func(c *Client)) *Client
- func (c *Client) OnRelayClosed(f func(data []byte)) *Client
- func (c *Client) OnRelayOpen(f func(data []byte)) *Client
- func (c *Client) OnRelayReset(f func(data []byte)) *Client
- func (c *Client) OnTimeout(f func(c *Client)) *Client
- func (c *Client) Port() int
- func (c *Client) ReconnectTime() time.Duration
- func (c *Client) ReconnectTimes() int
- func (c *Client) RelayCloseAll()
- func (c *Client) RelayClosed(relay []bool)
- func (c *Client) RelayOpen(relay []bool)
- func (c *Client) RelayOpenAll()
- func (c *Client) RelayReset()
- func (c *Client) Send(msg interface{}) error
- func (c *Client) SetAddress(address string) *Client
- func (c *Client) SetId(id string) *Client
- func (c *Client) SetPort(port int) *Client
- func (c *Client) SetReconnectTime(reconnectTime time.Duration) *Client
- func (c *Client) SetReconnectTimes(reconnectTimes int) *Client
- type CloseMessage
- type CloseMessageRequest
- type DisconnectedMessage
- type HeartBeat
- type IllegalMessage
- type MsgID
- type OpenMessage
- type OpenMessageRequest
- type ResetMessage
- type ResetMessageRequest
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
客户端
func (*Client) HeartBeatTime ¶
func (*Client) IsConnected ¶
func (*Client) IsReconnecting ¶
func (*Client) OnConnected ¶
func (*Client) OnConnecting ¶
func (*Client) OnDisconnect ¶
func (*Client) OnRelayClosed ¶
func (*Client) OnRelayOpen ¶
func (*Client) OnRelayReset ¶
func (*Client) ReconnectTime ¶
func (*Client) ReconnectTimes ¶
func (*Client) SetAddress ¶
func (*Client) SetReconnectTime ¶
func (*Client) SetReconnectTimes ¶
type DisconnectedMessage ¶
type IllegalMessage ¶
Click to show internal directories.
Click to hide internal directories.