proto

package
v0.0.0-...-5313827 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2018 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(typeInfo map[string]*reflection.TypeInfo, typeName string, buf []byte, fieldPath []int) (msg interface{}, err error)

func DecodeBytes

func DecodeBytes(buf []byte) (x []byte, i int)

func DecodeFixed32

func DecodeFixed32(buf []byte) (x uint32, i int)

func DecodeFixed64

func DecodeFixed64(buf []byte) (x uint64, i int)

func DecodeTag

func DecodeTag(buf []byte) (wireType int, fieldNumber int, i int)

func DecodeVarint

func DecodeVarint(buf []byte) (x uint64, i int)

func DecodeZigzag32

func DecodeZigzag32(buf []byte) (x uint64, i int)

func DecodeZigzag64

func DecodeZigzag64(buf []byte) (x uint64, i int)

func Encode

func Encode(typeInfo map[string]*reflection.TypeInfo, typeName string, data []FieldValue) (resBuf []byte, err error)

func EncodeBytes

func EncodeBytes(x []byte) (buf []byte)

func EncodeFixed32

func EncodeFixed32(x uint32) []byte

func EncodeFixed64

func EncodeFixed64(x uint64) []byte

func EncodeTag

func EncodeTag(n int, wt int) []byte

func EncodeVarint

func EncodeVarint(x uint64) []byte

func EncodeZigzag32

func EncodeZigzag32(x uint64) []byte

func EncodeZigzag64

func EncodeZigzag64(x uint64) []byte

func FetchMethodReflection

func FetchMethodReflection(serverAddr string, methodPath string) (result *reflection.Method, err error)

func FieldTypeToWireType

func FieldTypeToWireType(typeId descriptor.FieldDescriptorProto_Type) (wireType int)

func Invoke

func Invoke(ctx context.Context, addr string, packageName, serviceName, methodName string, data []FieldValue) (interface{}, error)

Types

type FieldValue

type FieldValue struct {
	Number int         `json:"number"`
	Value  interface{} `json:"val"`
}

type Message

type Message struct {
	TypeInfo map[string]*reflection.TypeInfo
	TypeName string
	Data     []FieldValue
	PB       map[string]interface{}
}

func (*Message) Marshal

func (m *Message) Marshal() ([]byte, error)

func (*Message) ProtoMessage

func (m *Message) ProtoMessage()

func (*Message) Reset

func (m *Message) Reset()

func (*Message) String

func (m *Message) String() string

func (*Message) Unmarshal

func (m *Message) Unmarshal(buf []byte) error

Jump to

Keyboard shortcuts

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