ptypes

package
v0.0.0-...-0c59bc6 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2019 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromGoogleTimestamp

func FromGoogleTimestamp(ts *google_tspb.Timestamp) *tspb.Timestamp

FromGoogleTimestamp converts a google.protobuf.Timestamp proto into a veqryn.protobuf.Timestamp proto

func StringTimestamp

func StringTimestamp(layout string, dateValue string) (*tspb.Timestamp, error)

StringTimestamp creates a veqryn.protobuf.Timestamp proto from a string with the given layout

func Timestamp

func Timestamp(ts *tspb.Timestamp) (time.Time, error)

Timestamp converts a veqryn.protobuf.Timestamp proto to a time.Time. It returns an error if the argument is invalid.

Unlike most Go functions, if Timestamp returns an error, the first return value is not the zero time.Time. Instead, it is the value obtained from the time.Unix function when passed the contents of the Timestamp, in the UTC locale. This may or may not be a meaningful time; many invalid Timestamps do map to valid time.Times.

A nil Timestamp returns an error. The first return value in that case is undefined.

func TimestampNow

func TimestampNow() *tspb.Timestamp

TimestampNow returns a veqryn.protobuf.Timestamp for the current time.

func TimestampProto

func TimestampProto(t time.Time) (*tspb.Timestamp, error)

TimestampProto converts the time.Time to a veqryn.protobuf.Timestamp proto. It returns an error if the resulting Timestamp is invalid.

func TimestampString

func TimestampString(ts *tspb.Timestamp) string

TimestampString returns the RFC 3339 string for valid Timestamps. For invalid Timestamps, it returns an error message in parentheses.

func ToGoogleTimestamp

func ToGoogleTimestamp(ts *tspb.Timestamp) *google_tspb.Timestamp

ToGoogleTimestamp converts a veqryn.protobuf.Timestamp proto into a google.protobuf.Timestamp proto

Types

This section is empty.

Directories

Path Synopsis
Package test is a reverse proxy.
Package test is a reverse proxy.

Jump to

Keyboard shortcuts

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