Documentation ¶
Index ¶
Constants ¶
View Source
const ( ProtoIDHeartbeatReq = uint32(1) ProtoIDHeartbeatRsp = uint32(2) ProtoIDEchoReq = uint32(3) ProtoIDEchoRsp = uint32(4) )
Variables ¶
View Source
var DefaultMessageProtocol = &MessageProtocol{}
Functions ¶
func RegMessageDef ¶
func RegMessageDef(def Message)
Types ¶
type EchoReq ¶
func NewEchoReq ¶
func NewEchoReq() *EchoReq
type EchoRsp ¶
func NewEchoRsp ¶
func NewEchoRsp() *EchoRsp
type HeaderReq ¶
func NewHeaderReq ¶
func NewHeaderReq() *HeaderReq
type HeaderRsp ¶
type HeaderRsp struct { ErrCode uint32 `json:"err_code,omitempty"` ErrMessage string `json:"err_message,omitempty"` Seq int64 `json:"seq,omitempty"` Ts int64 `json:"ts,omitempty"` }
func NewHeaderRsp ¶
func NewHeaderRsp() *HeaderRsp
type HeartbeatReq ¶
type HeartbeatReq struct {
Header *HeaderReq `json:"header"`
}
func NewHeartbeatReq ¶
func NewHeartbeatReq() *HeartbeatReq
func (*HeartbeatReq) Decode ¶
func (st *HeartbeatReq) Decode(bs []byte) error
func (*HeartbeatReq) Encode ¶
func (st *HeartbeatReq) Encode() ([]byte, error)
func (*HeartbeatReq) Name ¶
func (st *HeartbeatReq) Name() string
func (*HeartbeatReq) New ¶
func (st *HeartbeatReq) New() Message
func (*HeartbeatReq) NewST ¶
func (st *HeartbeatReq) NewST() DefineST
func (*HeartbeatReq) ProtoID ¶
func (st *HeartbeatReq) ProtoID() uint32
func (*HeartbeatReq) String ¶
func (st *HeartbeatReq) String() string
type HeartbeatRsp ¶
type HeartbeatRsp struct {
Header *HeaderRsp `json:"header"`
}
func NewHeartbeatRsp ¶
func NewHeartbeatRsp() *HeartbeatRsp
func (*HeartbeatRsp) Decode ¶
func (st *HeartbeatRsp) Decode(bs []byte) error
func (*HeartbeatRsp) Encode ¶
func (st *HeartbeatRsp) Encode() ([]byte, error)
func (*HeartbeatRsp) Name ¶
func (st *HeartbeatRsp) Name() string
func (*HeartbeatRsp) New ¶
func (st *HeartbeatRsp) New() Message
func (*HeartbeatRsp) NewST ¶
func (st *HeartbeatRsp) NewST() DefineST
func (*HeartbeatRsp) ProtoID ¶
func (st *HeartbeatRsp) ProtoID() uint32
func (*HeartbeatRsp) String ¶
func (st *HeartbeatRsp) String() string
Click to show internal directories.
Click to hide internal directories.