protobuf

package
v1.1.44 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: Apache-2.0 Imports: 8 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 Processor

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

Processor ------------------------- | id | protobuf message | -------------------------

func NewProcessor

func NewProcessor() *Processor

func (*Processor) Marshal

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

Marshal goroutine safe

func (*Processor) Range

func (p *Processor) Range(f func(id uint16, t reflect.Type))

Range goroutine safe

func (*Processor) Register

func (p *Processor) Register(msg proto.Message) uint16

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

func (*Processor) Route

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

Route goroutine safe

func (*Processor) SetByteOrder

func (p *Processor) SetByteOrder(littleEndian bool)

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

func (*Processor) SetHandler

func (p *Processor) SetHandler(msg proto.Message, msgHandler MsgHandler)

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

func (*Processor) SetRawHandler

func (p *Processor) SetRawHandler(id uint16, msgRawHandler MsgHandler)

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

func (*Processor) SetRouter

func (p *Processor) SetRouter(msg proto.Message, msgRouter *chanrpc.Server)

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

func (*Processor) Unmarshal

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

Unmarshal goroutine safe

Jump to

Keyboard shortcuts

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