Documentation
¶
Overview ¶
Package ptypes contains code for interacting with well-known types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Duration ¶
Duration converts a durpb.Duration to a time.Duration. Duration returns an error if the durpb.Duration is invalid or is too large to be represented in a time.Duration.
func DurationProto ¶
DurationProto converts a time.Duration to a durpb.Duration.
func Timestamp ¶
Timestamp converts a google.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 TimestampProto ¶
TimestampProto converts the time.Time to a google.protobuf.Timestamp proto. It returns an error if the resulting Timestamp is invalid.
Types ¶
This section is empty.
Directories
¶
Path | Synopsis |
---|---|
Package any is a generated protocol buffer package.
|
Package any is a generated protocol buffer package. |
Package duration is a generated protocol buffer package.
|
Package duration is a generated protocol buffer package. |
Package empty is a generated protocol buffer package.
|
Package empty is a generated protocol buffer package. |
Package structpb is a generated protocol buffer package.
|
Package structpb is a generated protocol buffer package. |
Package timestamp is a generated protocol buffer package.
|
Package timestamp is a generated protocol buffer package. |
Package wrappers is a generated protocol buffer package.
|
Package wrappers is a generated protocol buffer package. |