raw

package
v0.0.0-...-9a5e9c5 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const MaxID = 0xff >> 1

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 Processor

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

------------------------- | id | raw message | -------------------------

func NewProcessor

func NewProcessor() *Processor

func (*Processor) Marshal

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

goroutine safe

func (*Processor) Route

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

goroutine safe

func (*Processor) SetHandler

func (p *Processor) SetHandler(msgID byte, msgHandler MsgHandler)

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

func (*Processor) SetRouter

func (p *Processor) SetRouter(msgID byte, 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

type RawMsg

type RawMsg struct {
	ID   byte
	Data []byte
}

Jump to

Keyboard shortcuts

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