protoutils

package
v1.5.9 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2020 License: Apache-2.0 Imports: 8 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

This section is empty.

Jump to

Keyboard shortcuts

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