Documentation ¶
Index ¶
- type Channel
- type Client
- func (c *Client) Connect() error
- func (c *Client) Disconnect()
- func (c *Client) Flush() error
- func (c *Client) GetOptions() *Options
- func (c *Client) GetRecvMsgCount() int64
- func (c *Client) GetSendFailMsgCount() int64
- func (c *Client) GetSendMsgBytes() int64
- func (c *Client) SendMessage(channel *Channel, payload []byte, opt ...SendOption) error
- func (c *Client) SendMessageSync(ctx context.Context, channel *Channel, payload []byte) (*lmproto.SendackPacket, error)
- func (c *Client) SetOnClose(onClose OnClose)
- func (c *Client) SetOnRecv(onRecv OnRecv)
- func (c *Client) SetOnSendack(onSendack OnSendack)
- type OnClose
- type OnRecv
- type OnSendack
- type Option
- type Options
- type SendOption
- type SendOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client 狸猫客户端
func (*Client) GetRecvMsgCount ¶
GetRecvMsgCount GetRecvMsgCount
func (*Client) GetSendFailMsgCount ¶
GetSendFailMsgCount GetSendFailMsgCount
func (*Client) SendMessage ¶
func (c *Client) SendMessage(channel *Channel, payload []byte, opt ...SendOption) error
SendMessage 发送消息
func (*Client) SendMessageSync ¶
func (c *Client) SendMessageSync(ctx context.Context, channel *Channel, payload []byte) (*lmproto.SendackPacket, error)
SendMessageSync 同步发送
func (*Client) SetOnSendack ¶
SetOnSendack 设置发送回执
type Options ¶
type Options struct { ProtoVersion uint8 // 协议版本 UID string // 用户uid Token string // 连接IM的token AutoReconn bool //是否开启自动重连 }
Options Options
type SendOption ¶
type SendOption func(*SendOptions) error
SendOption 参数项
func SendOptionWithFlush ¶
func SendOptionWithFlush(flush bool) SendOption
SendOptionWithFlush 是否 io flush
func SendOptionWithNoPersist ¶
func SendOptionWithNoPersist(noPersist bool) SendOption
SendOptionWithNoPersist 是否不存储
func SendOptionWithRedDot ¶
func SendOptionWithRedDot(redDot bool) SendOption
SendOptionWithRedDot 是否显示红点
func SendOptionWithSyncOnce ¶
func SendOptionWithSyncOnce(syncOnce bool) SendOption
SendOptionWithSyncOnce 是否只同步一次(写模式)
Click to show internal directories.
Click to hide internal directories.