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 ¶
Types ¶
type 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) MarshalJSON ¶
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) UnmarshalJSON ¶
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.
Click to show internal directories.
Click to hide internal directories.