protoutils

package
v1.6.0-beta18 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NilStructError = eris.New("cannot unmarshal nil struct")
)

Functions

func AnyGogoToPb

func AnyGogoToPb(structuredData *types.Any) (*any.Any, error)

func AnyPbToGogo

func AnyPbToGogo(structuredData *any.Any) (*types.Any, error)

func MarshalBytes

func MarshalBytes(pb proto.Message) ([]byte, error)

func MarshalBytesEmitZeroValues

func MarshalBytesEmitZeroValues(pb proto.Message) ([]byte, error)

func MarshalStruct

func MarshalStruct(m proto.Message) (*structpb.Struct, error)

this function is designed for converting go object (that is not a proto.Message) into a pb Struct, based on json struct tags

func MarshalStructEmitZeroValues

func MarshalStructEmitZeroValues(m proto.Message) (*structpb.Struct, error)

func StructGogoToPb

func StructGogoToPb(structuredData *types.Struct) (*structpb.Struct, error)

func StructPbToGogo

func StructPbToGogo(structuredData *structpb.Struct) (*types.Struct, error)

func UnmarshalStruct

func UnmarshalStruct(structuredData *structpb.Struct, into proto.Message) error

Types

type MultiAnyResolver added in v1.5.10

type MultiAnyResolver struct{}

func (*MultiAnyResolver) Resolve added in v1.5.10

func (m *MultiAnyResolver) Resolve(typeUrl string) (proto.Message, error)

Jump to

Keyboard shortcuts

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