time

package module
v0.0.0-...-9adb218 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2017 License: MIT Imports: 2 Imported by: 1

README

time

Build Status

Just a wrapper around time with additions.

Documentation

Index

Constants

View Source
const (
	Nanosecond  = Duration(time.Nanosecond)
	Microsecond = Duration(time.Microsecond)
	Millisecond = Duration(time.Millisecond)
	Second      = Duration(time.Second)
	Minute      = Duration(time.Minute)
	Hour        = Duration(time.Hour)
)

Variables

This section is empty.

Functions

func Sleep

func Sleep(d Duration)

Types

type Duration

type Duration time.Duration

Duration is a wrapper around time.Duration which implements json.Unmarshaler and json.Marshaler. It marshals and unmarshals the duration as a string in the format accepted by time.ParseDuration and returned by time.Duration.String.

func (Duration) Duration

func (d Duration) Duration() time.Duration

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface. The duration is a quoted-string in the format accepted by time.ParseDuration and returned by time.Duration.String.

func (Duration) String

func (d Duration) String() string

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(buf []byte) error

UnmarshalJSON implements the json.Unmarshaler interface. The duration is expected to be a quoted-string of a duration in the format accepted by time.ParseDuration.

Jump to

Keyboard shortcuts

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