luci: go.chromium.org/luci/common/proto/google Index | Files | Directories

package google

import "go.chromium.org/luci/common/proto/google"

Package google contains utility methods to help interface between Google standard protobufs and native Go types.

Index

Package Files

doc.go util.go

func DurationFromProto Uses

func DurationFromProto(d *duration.Duration) time.Duration

DurationFromProto returns the time.Duration associated with a Duration protobuf.

func LoadDuration Uses

func LoadDuration(d *duration.Duration, v time.Duration) *duration.Duration

LoadDuration replaces the value in the supplied Duration with the specified value.

If the supplied Duration is nil and the value is non-zero, a new Duration will be generated. The populated Duration will be returned.

func LoadTimestamp Uses

func LoadTimestamp(t *timestamp.Timestamp, v time.Time) *timestamp.Timestamp

LoadTimestamp replaces the value in the supplied Timestamp with the specified time.

If the supplied Timestamp is nil and the time is non-zero, a new Timestamp will be generated. The populated Timestamp will be returned.

func NewDuration Uses

func NewDuration(v time.Duration) *duration.Duration

NewDuration creates a new Duration protobuf from a time.Duration.

func NewTimestamp Uses

func NewTimestamp(v time.Time) *timestamp.Timestamp

NewTimestamp creates a new Timestamp protobuf from a time.Time type.

func TimeFromProto Uses

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

TimeFromProto returns the time.Time associated with a Timestamp protobuf.

Directories

PathSynopsis
descutilPackage descutil contains utility functions for protobuf descriptor messages.

Package google imports 3 packages (graph) and is imported by 83 packages. Updated 2018-10-23. Refresh now. Tools for package owners.