tutils

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package tutils provides convenience functions to convert between proto representations and time.Time / time.Duration representations of times or durations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Duration

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

Duration coverts a duration proto to a time.Duration, and panics if there's an error.

func DurationProto

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

DurationProto coverts a time.Duration to proto.

func Timestamp

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

Timestamp converts a timestamp proto to a time.Time, and panics if there's an error.

func TimestampProto

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

TimestampProto converts a time.Time proto to a timestamp proto, and panics if there's an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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