Documentation
¶
Index ¶
Constants ¶
View Source
const ( MsgIdPingReq uint32 MsgIdPingAck )
a group of message ids
View Source
const ( MsgIdBroadCastReq uint32 MsgIdBroadCastAck )
broadcast messages
View Source
const ServerAddr = "0.0.0.0:8888"
Variables ¶
This section is empty.
Functions ¶
func RecoverMiddleware ¶
func RecoverMiddleware(log *logrus.Logger) easytcp.MiddlewareFunc
Types ¶
type CustomPacker ¶
type CustomPacker struct{}
CustomPacker custom packer payload format: totalSize(4)|typeSize(2)|type(n)|data(n)
| `totalSize` | `typeSize` | `type` | `data` | | ----------- | ---------- | ----------------------- | ------ | | uint32 | uint16 | []byte | []byte | | 4 bytes | 2 bytes | according to `typeSize` | |
type Json01Resp ¶
type Json01Resp struct { Success bool `json:"success"` Data interface{} `json:"data"` }
Click to show internal directories.
Click to hide internal directories.