Help us shape the future of Go! Take the 2026 Go Developer Survey

protoutils

package
v1.22.7 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func MarshalBytes

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

func MarshalBytesEmitZeroValues

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

func MarshalBytesIndented added in v1.17.0

func MarshalBytesIndented(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 UnmarshalAllowUnknown added in v1.17.0

func UnmarshalAllowUnknown(r io.Reader, into proto.Message) error

func UnmarshalBytes added in v1.6.0

func UnmarshalBytes(data []byte, into proto.Message) error

func UnmarshalBytesAllowUnknown added in v1.17.0

func UnmarshalBytesAllowUnknown(data []byte, into proto.Message) error

func UnmarshalYaml added in v1.6.0

func UnmarshalYaml(data []byte, 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