proto

package
v0.0.0-...-7b34d14 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromJSON

func FromJSON(content []byte, out proto.Message) error

func FromMap

func FromMap(in map[string]interface{}, out proto.Message) error

func FromYAML

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

func MarshalAnyDeterministic

func MarshalAnyDeterministic(pb proto.Message) (*any.Any, error)

When saving Snapshot in SnapshotCache we generate version based on proto.Equal() Therefore we need deterministic way of marshalling Any which is part of the Protobuf on which we execute Equal()

Based on proto.MarshalAny

func MustTimestampFromProto

func MustTimestampFromProto(ts *tspb.Timestamp) *time.Time

func MustTimestampProto

func MustTimestampProto(t time.Time) *tspb.Timestamp

func MustToStruct

func MustToStruct(message proto.Message) *pstruct.Struct

func TimestampString

func TimestampString(ts *tspb.Timestamp, layout string) string

func ToDuration

func ToDuration(duration duration.Duration) time.Duration

func ToJSON

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

func ToMap

func ToMap(pb proto.Message) (map[string]interface{}, error)

func ToStruct

func ToStruct(message proto.Message) (pstruct.Struct, error)

Converts loosely typed Struct to strongly typed Message

func ToTyped

func ToTyped(protoStruct *pstruct.Struct, message proto.Message) error

Converts loosely typed Struct to strongly typed Message

func ToYAML

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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