pb

package
v0.8.21 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BufToProto

func BufToProto(r io.Reader, msg proto.Message) error

BufToProto, unmarshal buffer to proto message instance.

func FromStructValue added in v0.8.7

func FromStructValue(from *structpb.Value, to interface{}) error

Attempts to map a *structpb.Struct to an interface{}, using mapstructure to map from the struct's fields to 'to'

func NewStruct

func NewStruct() *structpb.Struct

NewStruct, returns *structpb.Struct instance with initialized Fields map.

func ProtoToBuf

func ProtoToBuf(w io.Writer, msg proto.Message) error

ProtoToBuf, marshal proto message to buffer.

func ProtoToStr

func ProtoToStr(msg proto.Message) string

ProtoToStr, marshal proto message to string representation.

func ToStructValue added in v0.8.7

func ToStructValue(from interface{}) (*structpb.Value, error)

Attempts to construct a structpb.Struct from an interface{}, using mapstructure to map from 'from' to map[string]interface{}

func UnmarshalNext

func UnmarshalNext(d *json.Decoder, m proto.Message) error

UnmarshalNext, JSON decoder helper function to unmarshal next message.

Types

This section is empty.

Jump to

Keyboard shortcuts

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