Documentation ¶
Index ¶
- func DaysFromDuration(duration *time.Duration) int
- func DaysInt32FromDuration(duration *time.Duration) int32
- func DurationFromDays(d int32) *time.Duration
- func DurationFromHours(h int64) *time.Duration
- func DurationFromMinutes(m int64) *time.Duration
- func DurationFromSeconds(s int64) *time.Duration
- func DurationPtr(td time.Duration) *time.Duration
- func DurationValue(d *time.Duration) time.Duration
- func MinDurationPtr(d1 *time.Duration, d2 *time.Duration) *time.Duration
- func ParseDuration(s string) (time.Duration, error)
- func ParseDurationDefaultDays(s string) (time.Duration, error)
- func ParseDurationDefaultSeconds(s string) (time.Duration, error)
- func RoundUp(d time.Duration) time.Duration
- func TimeNowPtrUtc() *time.Time
- func TimeNowPtrUtcAddDuration(t time.Duration) *time.Time
- func TimeNowPtrUtcAddSeconds(seconds int) *time.Time
- func TimePtr(t time.Time) *time.Time
- func TimeValue(t *time.Time) time.Time
- func UnixOrZeroTime(nanos int64) time.Time
- func UnixOrZeroTimePtr(nanos int64) *time.Time
- type Timestamp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DaysFromDuration ¶ added in v0.28.0
func DaysInt32FromDuration ¶ added in v0.28.0
func DurationFromDays ¶ added in v0.28.0
func DurationFromHours ¶ added in v0.28.0
func DurationFromMinutes ¶ added in v0.28.0
func DurationFromSeconds ¶ added in v0.28.0
func MinDurationPtr ¶ added in v0.28.0
func ParseDuration ¶ added in v1.11.0
ParseDuration is like time.ParseDuration, but supports unit "d" for days (always interpreted as exactly 24 hours).
func ParseDurationDefaultDays ¶ added in v1.11.0
ParseDurationDefaultDays is like time.ParseDuration, but supports unit "d" for days (always interpreted as exactly 24 hours), and also supports unit-less numbers, which are interpreted as days.
func ParseDurationDefaultSeconds ¶ added in v1.21.0
ParseDurationDefaultSeconds is like time.ParseDuration, but supports unit "d" for days (always interpreted as exactly 24 hours), and also supports unit-less numbers, which are interpreted as seconds.
func TimeNowPtrUtc ¶ added in v0.28.0
func TimeNowPtrUtcAddDuration ¶ added in v0.28.0
func TimeNowPtrUtcAddSeconds ¶ added in v0.28.0
func UnixOrZeroTime ¶ added in v0.28.0
func UnixOrZeroTimePtr ¶ added in v0.28.0
Types ¶
type Timestamp ¶
type Timestamp struct {
// contains filtered or unexported fields
}
Timestamp provides easy conversions and utility comparison functions making go to proto time comparison straightforward
func TimestampEpoch ¶
func TimestampEpoch() *Timestamp
TimestampEpoch returns the unix epoch -TimestampFromTime(time.Unix(0, 0)).UTC() noinspection GoNameStartsWithPackageName
func TimestampFromProto ¶
TimestampFromProto returns a Timestamp from proto time noinspection GoNameStartsWithPackageName
func TimestampFromTime ¶
TimestampFromTimePtr returns a Timestamp from a time.time noinspection GoNameStartsWithPackageName
func TimestampFromTimePtr ¶ added in v0.28.0
TimestampFromTimePtr returns a Timestamp from a time.time noinspection GoNameStartsWithPackageName
func TimestampNow ¶
func TimestampNow() *Timestamp
TimestampNow returns a timestamp that represents Now() noinspection GoNameStartsWithPackageName
func TimestampNowAddSeconds ¶
TimestampNowAddSeconds returns a timestamp that represents Now() + some number of seconds noinspection GoNameStartsWithPackageName
func (*Timestamp) After ¶
Before returns true when t1 is after t2, false otherwise noinspection GoReceiverNames
func (*Timestamp) Before ¶
Before returns true when t1 is before t2, false otherwise noinspection GoReceiverNames
func (*Timestamp) SameAs ¶
SamesAs returns true when t1 is the same time as t2, false otherwise noinspection GoReceiverNames