json

package
v0.0.0-...-2a34eab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MsgHandler

type MsgHandler func([]interface{})

type MsgInfo

type MsgInfo struct {
	// contains filtered or unexported fields
}

type MsgRaw

type MsgRaw struct {
	// contains filtered or unexported fields
}

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) Marshal

func (p *Processor) Marshal(msg interface{}) ([][]byte, error)

goroutine safe

func (*Processor) Register

func (p *Processor) Register(msg interface{}) string

It's dangerous to call the method on routing or marshaling (unmarshaling)

func (*Processor) Route

func (p *Processor) Route(msg interface{}, userData interface{}) error

goroutine safe

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)

func (*Processor) SetRouter

func (p *Processor) SetRouter(msg interface{}, msgRouter *chanrpc.Server)

It's dangerous to call the method on routing or marshaling (unmarshaling)

func (*Processor) Unmarshal

func (p *Processor) Unmarshal(data []byte) (interface{}, error)

goroutine safe

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL