Documentation ¶
Overview ¶
简单的handler管理器 非线程安全
内部错误封装 base on protobuff
Package services is a generated protocol buffer package.
It is generated from these files:
inner.proto
It has these top-level messages:
HeartbeatReq HeartbeatAck ErrorAck
Index ¶
- Constants
- func GetHandler(id uint16) handler
- func NewInError(err error) []byte
- func NewLogicError(id int) []byte
- func NewSInError(err error) *network.Data_Frame
- func NewSLogicError(id int) *network.Data_Frame
- func Register(id uint16, hand handler)
- func UnRegister(id uint16)
- type ErrorAck
- type HeartbeatAck
- type HeartbeatReq
- type MsgHandler
Constants ¶
View Source
const (
CLOSE_CONNECT = 10 // 连接关闭
)
Variables ¶
This section is empty.
Functions ¶
func GetHandler ¶
func GetHandler(id uint16) handler
func NewSInError ¶
func NewSInError(err error) *network.Data_Frame
构建一个service通用内部错误(errid=1) @params err:错误描述
func NewSLogicError ¶
func NewSLogicError(id int) *network.Data_Frame
构建一个service通用业务错误 @params id:错误码
func UnRegister ¶
func UnRegister(id uint16)
Types ¶
type ErrorAck ¶
type ErrorAck struct { Errid *int32 `protobuf:"varint,1,req,name=errid" json:"errid,omitempty"` Errstr *string `protobuf:"bytes,2,req,name=errstr" json:"errstr,omitempty"` XXX_unrecognized []byte `json:"-"` }
通用的错误回复2
func (*ErrorAck) Descriptor ¶
func (*ErrorAck) ProtoMessage ¶
func (*ErrorAck) ProtoMessage()
type HeartbeatAck ¶
type HeartbeatAck struct {
XXX_unrecognized []byte `json:"-"`
}
心跳回复1
func (*HeartbeatAck) Descriptor ¶
func (*HeartbeatAck) Descriptor() ([]byte, []int)
func (*HeartbeatAck) ProtoMessage ¶
func (*HeartbeatAck) ProtoMessage()
func (*HeartbeatAck) Reset ¶
func (m *HeartbeatAck) Reset()
func (*HeartbeatAck) String ¶
func (m *HeartbeatAck) String() string
type HeartbeatReq ¶
type HeartbeatReq struct {
XXX_unrecognized []byte `json:"-"`
}
心跳请求0
func (*HeartbeatReq) Descriptor ¶
func (*HeartbeatReq) Descriptor() ([]byte, []int)
func (*HeartbeatReq) ProtoMessage ¶
func (*HeartbeatReq) ProtoMessage()
func (*HeartbeatReq) Reset ¶
func (m *HeartbeatReq) Reset()
func (*HeartbeatReq) String ¶
func (m *HeartbeatReq) String() string
type MsgHandler ¶
type MsgHandler struct { MsgId uint16 MsgHandler handler }
Click to show internal directories.
Click to hide internal directories.