utils

package
v5.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2018 License: Apache-2.0, Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MILLISECONDS TimeUnit = "milliseconds"
	SECONDS               = "seconds"
	MINUTES               = "minutes"
	HOURS                 = "hours"
	DAYS                  = "days"
	WEEKS                 = "weeks"
	MONTHS                = "months"
	YEARS                 = "years"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RelativeTime

type RelativeTime struct {
	RTvalue int      `json:"value,omitempty"`
	RTunit  TimeUnit `json:"unit,omitempty"`
}

func NewRelativeTime

func NewRelativeTime(value int, unit TimeUnit) *RelativeTime

func (*RelativeTime) RelativeTimeTo

func (rt *RelativeTime) RelativeTimeTo(t time.Time) time.Time

func (*RelativeTime) Unit

func (rt *RelativeTime) Unit() TimeUnit

func (*RelativeTime) Value

func (rt *RelativeTime) Value() int

type TimeUnit

type TimeUnit string

Jump to

Keyboard shortcuts

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