Documentation ¶
Index ¶
- Constants
- Variables
- func Decode(buffer []byte) (pkgType int, body []byte)
- func Encode(pkgType int, body []byte) *[]byte
- func GetByteOrder() bool
- func SetByteOrder(littleEndian bool)
- type EErrorCode
- type EMsgType
- type ReqHeartbeat
- func (*ReqHeartbeat) Descriptor() ([]byte, []int)
- func (*ReqHeartbeat) ProtoMessage()
- func (m *ReqHeartbeat) Reset()
- func (m *ReqHeartbeat) String() string
- func (m *ReqHeartbeat) XXX_DiscardUnknown()
- func (m *ReqHeartbeat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ReqHeartbeat) XXX_Merge(src proto.Message)
- func (m *ReqHeartbeat) XXX_Size() int
- func (m *ReqHeartbeat) XXX_Unmarshal(b []byte) error
- type RespResult
- func (*RespResult) Descriptor() ([]byte, []int)
- func (m *RespResult) GetCode() int32
- func (m *RespResult) GetMsg() string
- func (*RespResult) ProtoMessage()
- func (m *RespResult) Reset()
- func (m *RespResult) String() string
- func (m *RespResult) XXX_DiscardUnknown()
- func (m *RespResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RespResult) XXX_Merge(src proto.Message)
- func (m *RespResult) XXX_Size() int
- func (m *RespResult) XXX_Unmarshal(b []byte) error
Constants ¶
View Source
const ( PKG_SIZE_BYTES = 4 PKG_TYPE_BYTES = 4 )
View Source
const ( TYPE_NULL = iota TYPE_HANDSHAKE //1 TYPE_HANDSHAKE_ACK //2 TYPE_HEARTBEAT //3 TYPE_DATA //4 TYPE_KICK //5 PKG_HEAD_BYTES = 4 )
Variables ¶
View Source
var EErrorCode_name = map[int32]string{
0: "INVALID_ERROR_CODE",
1: "SUCCESS",
2: "ERROR_ROUTE_ID",
3: "ERROR_KICK_BY_SERVER",
}
View Source
var EErrorCode_value = map[string]int32{
"INVALID_ERROR_CODE": 0,
"SUCCESS": 1,
"ERROR_ROUTE_ID": 2,
"ERROR_KICK_BY_SERVER": 3,
}
View Source
var EMsgType_name = map[int32]string{
0: "INVALID_TYPE",
70000: "TYPE_HEARTBEAT",
70001: "TYPE_COMMON_RESULT",
70002: "TYPE_KICK_BY_SERVER",
}
View Source
var EMsgType_value = map[string]int32{
"INVALID_TYPE": 0,
"TYPE_HEARTBEAT": 70000,
"TYPE_COMMON_RESULT": 70001,
"TYPE_KICK_BY_SERVER": 70002,
}
Functions ¶
func Encode ¶
*
- Package protocol encode. *
- +------+------+------------------+
- | size | type | body |
- +------+------+------------------+ *
func GetByteOrder ¶
func GetByteOrder() bool
func SetByteOrder ¶
func SetByteOrder(littleEndian bool)
Types ¶
type EErrorCode ¶
type EErrorCode int32
const ( EErrorCode_INVALID_ERROR_CODE EErrorCode = 0 EErrorCode_SUCCESS EErrorCode = 1 EErrorCode_ERROR_ROUTE_ID EErrorCode = 2 EErrorCode_ERROR_KICK_BY_SERVER EErrorCode = 3 )
func (EErrorCode) EnumDescriptor ¶
func (EErrorCode) EnumDescriptor() ([]byte, []int)
func (EErrorCode) String ¶
func (x EErrorCode) String() string
type ReqHeartbeat ¶
type ReqHeartbeat struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ReqHeartbeat) Descriptor ¶
func (*ReqHeartbeat) Descriptor() ([]byte, []int)
func (*ReqHeartbeat) ProtoMessage ¶
func (*ReqHeartbeat) ProtoMessage()
func (*ReqHeartbeat) Reset ¶
func (m *ReqHeartbeat) Reset()
func (*ReqHeartbeat) String ¶
func (m *ReqHeartbeat) String() string
func (*ReqHeartbeat) XXX_DiscardUnknown ¶
func (m *ReqHeartbeat) XXX_DiscardUnknown()
func (*ReqHeartbeat) XXX_Marshal ¶
func (m *ReqHeartbeat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ReqHeartbeat) XXX_Merge ¶
func (m *ReqHeartbeat) XXX_Merge(src proto.Message)
func (*ReqHeartbeat) XXX_Size ¶
func (m *ReqHeartbeat) XXX_Size() int
func (*ReqHeartbeat) XXX_Unmarshal ¶
func (m *ReqHeartbeat) XXX_Unmarshal(b []byte) error
type RespResult ¶
type RespResult struct { Code int32 `protobuf:"varint,1,opt,name=Code,proto3" json:"Code,omitempty"` Msg string `protobuf:"bytes,2,opt,name=Msg,proto3" json:"Msg,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*RespResult) Descriptor ¶
func (*RespResult) Descriptor() ([]byte, []int)
func (*RespResult) GetCode ¶
func (m *RespResult) GetCode() int32
func (*RespResult) GetMsg ¶
func (m *RespResult) GetMsg() string
func (*RespResult) ProtoMessage ¶
func (*RespResult) ProtoMessage()
func (*RespResult) Reset ¶
func (m *RespResult) Reset()
func (*RespResult) String ¶
func (m *RespResult) String() string
func (*RespResult) XXX_DiscardUnknown ¶
func (m *RespResult) XXX_DiscardUnknown()
func (*RespResult) XXX_Marshal ¶
func (m *RespResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*RespResult) XXX_Merge ¶
func (m *RespResult) XXX_Merge(src proto.Message)
func (*RespResult) XXX_Size ¶
func (m *RespResult) XXX_Size() int
func (*RespResult) XXX_Unmarshal ¶
func (m *RespResult) XXX_Unmarshal(b []byte) error
Click to show internal directories.
Click to hide internal directories.