time

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2020 License: MPL-2.0, MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Datetime

func Datetime(c Clock) string

Datetime returns the UTC date+time in format YYYYMMDD-HHMM.

func DurationShort

func DurationShort(d std_time.Duration) string

Types

type Clock

type Clock interface {
	Now() std_time.Time
	NewTimer(std_time.Duration) Timer
}

type RealClock

type RealClock struct{}

func (RealClock) NewTimer

func (r RealClock) NewTimer(d std_time.Duration) Timer

func (RealClock) Now

func (r RealClock) Now() std_time.Time

Now returns the current UTC time.Time (unlike the standard lib which returns local).

type RealTimer

type RealTimer struct {
	// contains filtered or unexported fields
}

func (*RealTimer) C

func (f *RealTimer) C() <-chan std_time.Time

func (*RealTimer) Reset

func (f *RealTimer) Reset(d std_time.Duration) bool

func (*RealTimer) Stop

func (f *RealTimer) Stop() bool

type Timer

type Timer interface {
	Reset(std_time.Duration) bool
	Stop() bool
	C() <-chan std_time.Time
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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