Documentation
¶
Index ¶
- type JsonMsgRaw
- type JsonProcessor
- func (p *JsonProcessor) GetMsgInfo(msg interface{}) (*MsgInfo, error)
- func (p *JsonProcessor) Marshal(msg interface{}) ([][]byte, error)
- func (p *JsonProcessor) Register(msg interface{}, msgHandleWayType MsgHandleWayType) string
- func (p *JsonProcessor) Route(msg interface{}, userData interface{}) error
- func (p *JsonProcessor) SetHandler(msg interface{}, msgHandler MsgHandler)
- func (p *JsonProcessor) SetRawHandler(msgID string, msgRawHandler MsgHandler)
- func (p *JsonProcessor) SetRouter(msg interface{}, msgRouter *chanrpc.Server)
- func (p *JsonProcessor) Unmarshal(data []byte) (interface{}, error)
- type MsgHandleWayType
- type MsgHandler
- type MsgInfo
- type Processor
- type ProtobufMsgRaw
- type ProtobufProcessor
- func (p *ProtobufProcessor) GetMsgInfo(msg interface{}) (*MsgInfo, error)
- func (p *ProtobufProcessor) GetMsgNameId() map[string]uint16
- func (p *ProtobufProcessor) Marshal(msg interface{}) ([][]byte, error)
- func (p *ProtobufProcessor) Range(f func(id uint16, t reflect.Type))
- func (p *ProtobufProcessor) Register(msg proto.Message, eventType uint16, msgHandleWayType MsgHandleWayType) uint16
- func (p *ProtobufProcessor) Route(msg interface{}, userData interface{}) error
- func (p *ProtobufProcessor) SetByteOrder(littleEndian bool)
- func (p *ProtobufProcessor) SetHandler(msg proto.Message, msgHandler MsgHandler)
- func (p *ProtobufProcessor) SetRawHandler(id uint16, msgRawHandler MsgHandler)
- func (p *ProtobufProcessor) SetRouter(msg proto.Message, msgRouter *chanrpc.Server)
- func (p *ProtobufProcessor) Unmarshal(data []byte) (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JsonMsgRaw ¶
type JsonMsgRaw struct {
// contains filtered or unexported fields
}
type JsonProcessor ¶
type JsonProcessor struct {
// contains filtered or unexported fields
}
func NewJsonProcessor ¶
func NewJsonProcessor() *JsonProcessor
func (*JsonProcessor) GetMsgInfo ¶
func (p *JsonProcessor) GetMsgInfo(msg interface{}) (*MsgInfo, error)
func (*JsonProcessor) Marshal ¶
func (p *JsonProcessor) Marshal(msg interface{}) ([][]byte, error)
goroutine safe
func (*JsonProcessor) Register ¶
func (p *JsonProcessor) Register(msg interface{}, msgHandleWayType MsgHandleWayType) string
Register It's dangerous to call the method on routing or marshaling (unmarshaling)
func (*JsonProcessor) Route ¶
func (p *JsonProcessor) Route(msg interface{}, userData interface{}) error
goroutine safe
func (*JsonProcessor) SetHandler ¶
func (p *JsonProcessor) SetHandler(msg interface{}, msgHandler MsgHandler)
It's dangerous to call the method on routing or marshaling (unmarshaling)
func (*JsonProcessor) SetRawHandler ¶
func (p *JsonProcessor) SetRawHandler(msgID string, msgRawHandler MsgHandler)
It's dangerous to call the method on routing or marshaling (unmarshaling)
func (*JsonProcessor) SetRouter ¶
func (p *JsonProcessor) SetRouter(msg interface{}, msgRouter *chanrpc.Server)
It's dangerous to call the method on routing or marshaling (unmarshaling)
func (*JsonProcessor) Unmarshal ¶
func (p *JsonProcessor) Unmarshal(data []byte) (interface{}, error)
goroutine safe
type MsgHandleWayType ¶
type MsgHandleWayType uint
MsgHandleWayType 定义支持的消息处理方式类型
const ( MsgHandleWayTypeGlobalSync MsgHandleWayType = iota // 全局同步 会交由全局的消息队列进行同步调度到具体handle MsgHandleWayTypeAgentSync // 交由agent本身的消息队列 同步调度到具体handle MsgHandleWayTypeAgentAsync // 交由agent本身的消息队列 异s步调度到具体handle )
func (MsgHandleWayType) Valid ¶
func (receiver MsgHandleWayType) Valid() bool
type MsgHandler ¶
type MsgHandler func([]interface{})
type MsgInfo ¶
type MsgInfo struct {
// contains filtered or unexported fields
}
func (*MsgInfo) GetMsgHandleWayType ¶
func (m *MsgInfo) GetMsgHandleWayType() MsgHandleWayType
func (*MsgInfo) GetMsgRouter ¶
func (*MsgInfo) GetMsgType ¶
type ProtobufMsgRaw ¶
type ProtobufMsgRaw struct {
// contains filtered or unexported fields
}
type ProtobufProcessor ¶
type ProtobufProcessor struct {
// contains filtered or unexported fields
}
------------------------- | id | protobuf message | -------------------------
func NewProtobufProcessor ¶
func NewProtobufProcessor() *ProtobufProcessor
func (*ProtobufProcessor) GetMsgInfo ¶
func (p *ProtobufProcessor) GetMsgInfo(msg interface{}) (*MsgInfo, error)
func (*ProtobufProcessor) GetMsgNameId ¶
func (p *ProtobufProcessor) GetMsgNameId() map[string]uint16
func (*ProtobufProcessor) Marshal ¶
func (p *ProtobufProcessor) Marshal(msg interface{}) ([][]byte, error)
goroutine safe
func (*ProtobufProcessor) Range ¶
func (p *ProtobufProcessor) Range(f func(id uint16, t reflect.Type))
goroutine safe
func (*ProtobufProcessor) Register ¶
func (p *ProtobufProcessor) Register(msg proto.Message, eventType uint16, msgHandleWayType MsgHandleWayType) uint16
It's dangerous to call the method on routing or marshaling (unmarshaling)
func (*ProtobufProcessor) Route ¶
func (p *ProtobufProcessor) Route(msg interface{}, userData interface{}) error
goroutine safe
func (*ProtobufProcessor) SetByteOrder ¶
func (p *ProtobufProcessor) SetByteOrder(littleEndian bool)
It's dangerous to call the method on routing or marshaling (unmarshaling)
func (*ProtobufProcessor) SetHandler ¶
func (p *ProtobufProcessor) SetHandler(msg proto.Message, msgHandler MsgHandler)
It's dangerous to call the method on routing or marshaling (unmarshaling)
func (*ProtobufProcessor) SetRawHandler ¶
func (p *ProtobufProcessor) SetRawHandler(id uint16, msgRawHandler MsgHandler)
It's dangerous to call the method on routing or marshaling (unmarshaling)
func (*ProtobufProcessor) SetRouter ¶
func (p *ProtobufProcessor) SetRouter(msg proto.Message, msgRouter *chanrpc.Server)
It's dangerous to call the method on routing or marshaling (unmarshaling)
func (*ProtobufProcessor) Unmarshal ¶
func (p *ProtobufProcessor) Unmarshal(data []byte) (interface{}, error)
goroutine safe