MessageHandler 接收服务器端推送来的消息
| 19 | |
| 20 | // MessageHandler 接收服务器端推送来的消息 |
| 21 | type MessageHandler interface { |
| 22 | // OnRecv 这函数理论上是多线程调用,客户端需要注意下 |
| 23 | OnRecv(event int32, operate int32, id int64, group int64, from int64, to int64, body string) |
| 24 | |
| 25 | // OnError 连接被服务器断开,或其它错误 |
| 26 | OnError(msg string) |
| 27 | |
| 28 | // OnHealth 连接正常 |
| 29 | OnHealth() |
| 30 | |
| 31 | // OnUnHealth 连接异常 |
| 32 | OnUnHealth(msg string) |
| 33 | } |
| 34 | |
| 35 | // CandyClient 客户端提供和服务器交互的接口 |
| 36 | type CandyClient struct { |
no outgoing calls
no test coverage detected