protoutils

package
v0.0.0-...-3511abf Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultStringValue = ""

DefaultStringValue is the default string value.

Variables

This section is empty.

Functions

func TimeProtoSliceFromTimes

func TimeProtoSliceFromTimes(times []time.Time) ([]*timestamppb.Timestamp, error)

TimeProtoSliceFromTimes converts a slice of strings to a slice of *timestamppb.Timestamp.

func TimeSliceFromProto

func TimeSliceFromProto(pTimes []*timestamppb.Timestamp) ([]time.Time, error)

TimeSliceFromProto converts a slice of *timestamppb.Timestamp to a slice of time.Time.

func ToStruct

func ToStruct(v interface{}) *structpb.Struct

ToStruct converts a Go interface to a protobuf struct.

func ToTime

func ToTime(pt *timestamppb.Timestamp) (time.Time, error)

ToTime converts a *timestamppb.Timestamp to a *time.Time.

func ToTimestamp

func ToTimestamp(t time.Time) *timestamp.Timestamp

ToTimestamp converts a Go time struct to a protobuf message.

Types

This section is empty.

Directories

Path Synopsis
Package protoless provides some helpers for comparing specific proto objects.
Package protoless provides some helpers for comparing specific proto objects.

Jump to

Keyboard shortcuts

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