Documentation
¶
Index ¶
- Constants
- func Encode(msg Message) ([]byte, error)
- func RegMessageDef(def Message)
- type DefineST
- type EchoReq
- func (st *EchoReq) Decode(bs []byte) error
- func (st *EchoReq) Encode() ([]byte, error)
- func (st *EchoReq) GetHeader() *HeaderReq
- func (st *EchoReq) Name() string
- func (st *EchoReq) New() Message
- func (st *EchoReq) NewST() DefineST
- func (st *EchoReq) ProtoID() uint32
- func (st *EchoReq) String() string
- type EchoRsp
- type HeaderReq
- type HeaderRsp
- type HeartbeatReq
- func (st *HeartbeatReq) Decode(bs []byte) error
- func (st *HeartbeatReq) Encode() ([]byte, error)
- func (st *HeartbeatReq) GetHeader() *HeaderReq
- func (st *HeartbeatReq) Name() string
- func (st *HeartbeatReq) New() Message
- func (st *HeartbeatReq) NewST() DefineST
- func (st *HeartbeatReq) ProtoID() uint32
- func (st *HeartbeatReq) String() string
- type HeartbeatRsp
- type Message
- type SubAElem
- type SubAReq
- func (st *SubAReq) Decode(bs []byte) error
- func (st *SubAReq) Encode() ([]byte, error)
- func (st *SubAReq) GetHeader() *HeaderReq
- func (st *SubAReq) Name() string
- func (st *SubAReq) New() Message
- func (st *SubAReq) NewST() DefineST
- func (st *SubAReq) ProtoID() uint32
- func (st *SubAReq) String() string
- type SubARsp
- type SubBReq
- func (st *SubBReq) Decode(bs []byte) error
- func (st *SubBReq) Encode() ([]byte, error)
- func (st *SubBReq) GetHeader() *HeaderReq
- func (st *SubBReq) Name() string
- func (st *SubBReq) New() Message
- func (st *SubBReq) NewST() DefineST
- func (st *SubBReq) ProtoID() uint32
- func (st *SubBReq) String() string
- type SubBRsp
- type SubST
Constants ¶
View Source
const ( ProtoIDMin = uint32(0) //Invalid ID ProtoIDHeartbeatReq = uint32(1) ProtoIDHeartbeatRsp = uint32(2) ProtoIDEchoReq = uint32(5) ProtoIDEchoRsp = uint32(6) ProtoIDSubAReq = uint32(30001) ProtoIDSubARsp = uint32(30002) ProtoIDSubBReq = uint32(30003) ProtoIDSubBRsp = uint32(30004) )
ProtoID
View Source
const ( ErrCodeOK = uint32(0) ErrCodeFail = uint32(1) )
ErrorCode
Variables ¶
This section is empty.
Functions ¶
func RegMessageDef ¶
func RegMessageDef(def Message)
Types ¶
type EchoReq ¶ added in v0.3.0
func NewEchoReq ¶ added in v0.3.0
func NewEchoReq() *EchoReq
type EchoRsp ¶ added in v0.3.0
func NewEchoRsp ¶ added in v0.3.0
func NewEchoRsp() *EchoRsp
type HeaderReq ¶
type HeaderReq struct {
Seq int32 `json:"seq,omitempty"`
Ts int64 `json:"ts,omitempty"` //timestamp millisecond
}
request header
func NewHeaderReq ¶
func NewHeaderReq() *HeaderReq
type HeaderRsp ¶
type HeaderRsp struct {
//Multi doc string
//IDArr
ArrI []int32 `json:"arr_i,omitempty"`
ArrT []*SubST `json:"arr_t,omitempty"`
B1 bool `json:"b_1,omitempty"`
ErrCode uint32 `json:"err_code,omitempty"`
ErrMessage string `json:"err_message,omitempty"` //maybe more detail than ErrCode
F1 float64 `json:"f_1,omitempty"`
MapSS map[string]string `json:"map_ss,omitempty"`
Seq int32 `json:"seq,omitempty"`
St *SubST `json:"st,omitempty"`
Text []byte `json:"text,omitempty"`
Ts int64 `json:"ts,omitempty"` //timestamp millisecond
}
response header
func NewHeaderRsp ¶
func NewHeaderRsp() *HeaderRsp
type HeartbeatReq ¶
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) GetHeader ¶ added in v0.3.0
func (st *HeartbeatReq) GetHeader() *HeaderReq
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 ¶
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
type SubAElem ¶
type SubAElem struct {
IDList []string `json:"id_list,omitempty"`
Lang string `json:"lang,omitempty"`
}
func NewSubAElem ¶
func NewSubAElem() *SubAElem
type SubAReq ¶
func NewSubAReq ¶
func NewSubAReq() *SubAReq
type SubARsp ¶
type SubARsp struct {
Header *HeaderRsp `json:"header"`
Modified []string `json:"modified,omitempty"`
}
func NewSubARsp ¶
func NewSubARsp() *SubARsp
type SubBReq ¶
func NewSubBReq ¶
func NewSubBReq() *SubBReq
type SubBRsp ¶
type SubBRsp struct {
Header *HeaderRsp `json:"header"`
Modified []string `json:"modified,omitempty"`
}
func NewSubBRsp ¶
func NewSubBRsp() *SubBRsp
Click to show internal directories.
Click to hide internal directories.