Documentation ¶
Index ¶
- type MsgHandler
- type MsgInfo
- type MsgRaw
- type NeooneProcessor
- func (p *NeooneProcessor) Marshal(msg interface{}) ([][]byte, error)
- func (p *NeooneProcessor) Register(msgID string, msg interface{})
- func (p *NeooneProcessor) RegisterJSON(msg interface{}) string
- func (p *NeooneProcessor) Route(msg interface{}, userData interface{}) error
- func (p *NeooneProcessor) SetHandler(msgID string, msgHandler MsgHandler)
- func (p *NeooneProcessor) SetRawHandler(msgID string, msgRawHandler MsgHandler)
- func (p *NeooneProcessor) SetRouter(msgID string, msgRouter *chanrpc.Server)
- func (p *NeooneProcessor) SetRouterJSON(msg interface{}, msgRouter *chanrpc.Server)
- func (p *NeooneProcessor) Unmarshal(data []byte) (interface{}, error)
- type Processor
- func (p *Processor) Marshal(msg interface{}) ([][]byte, error)
- func (p *Processor) Register(msg interface{}) string
- func (p *Processor) Route(msg interface{}, userData interface{}) error
- func (p *Processor) SetHandler(msg interface{}, msgHandler MsgHandler)
- func (p *Processor) SetRawHandler(msgID string, msgRawHandler MsgHandler)
- func (p *Processor) SetRouter(msg interface{}, msgRouter *chanrpc.Server)
- func (p *Processor) Unmarshal(data []byte) (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MsgHandler ¶
type MsgHandler func([]interface{})
type NeooneProcessor ¶
type NeooneProcessor struct {
// contains filtered or unexported fields
}
func NewNeooneProcessor ¶
func NewNeooneProcessor() *NeooneProcessor
func (*NeooneProcessor) Marshal ¶
func (p *NeooneProcessor) Marshal(msg interface{}) ([][]byte, error)
func (*NeooneProcessor) Register ¶
func (p *NeooneProcessor) Register(msgID string, msg interface{})
Register is a extension for old Neoone msg struct. In common, don't use this func to register your msg in new project.
func (*NeooneProcessor) RegisterJSON ¶
func (p *NeooneProcessor) RegisterJSON(msg interface{}) string
RegisterJSON is used to pure json message
func (*NeooneProcessor) Route ¶
func (p *NeooneProcessor) Route(msg interface{}, userData interface{}) error
func (*NeooneProcessor) SetHandler ¶
func (p *NeooneProcessor) SetHandler(msgID string, msgHandler MsgHandler)
SetHandler is a extension for old Neoone msg struct. In common, don't use this func to register your msg in new project.
func (*NeooneProcessor) SetRawHandler ¶
func (p *NeooneProcessor) SetRawHandler(msgID string, msgRawHandler MsgHandler)
SetRawHandler is a extension for old Neoone msg struct. In common, don't use this func to register your msg in new project.
func (*NeooneProcessor) SetRouter ¶
func (p *NeooneProcessor) SetRouter(msgID string, msgRouter *chanrpc.Server)
SetRouter is a extension for old Neoone msg struct. In common, don't use this func to register your msg in new project.
func (*NeooneProcessor) SetRouterJSON ¶
func (p *NeooneProcessor) SetRouterJSON(msg interface{}, msgRouter *chanrpc.Server)
SetRouterJSON is Used for pure json message
func (*NeooneProcessor) Unmarshal ¶
func (p *NeooneProcessor) Unmarshal(data []byte) (interface{}, error)
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
func NewProcessor ¶
func NewProcessor() *Processor
func (*Processor) Register ¶
It's dangerous to call the method on routing or marshaling (unmarshaling)
func (*Processor) SetHandler ¶
func (p *Processor) SetHandler(msg interface{}, msgHandler MsgHandler)
It's dangerous to call the method on routing or marshaling (unmarshaling)
func (*Processor) SetRawHandler ¶
func (p *Processor) SetRawHandler(msgID string, msgRawHandler MsgHandler)
It's dangerous to call the method on routing or marshaling (unmarshaling)