Documentation ¶
Index ¶
Constants ¶
const DurationHelp = "A duration string is a sequence of <number><unit> such as 2h15m. " +
"Supported units are 'ns', 'us'/'µs', 'ms', 's', 'm', and 'h'."
DurationHelp is generic Duration help.
Variables ¶
This section is empty.
Functions ¶
func FormatDuration ¶
FormatDuration formats a time.Duration into a string that can be parsed with ParseDuration.
Types ¶
type Duration ¶
Duration is a Flag- and JSON-compatible Duration value.
func ParseDuration ¶
ParseDuration parses a clockflag Duration from a string. This is basically a typed fall-through to time.ParseDuration.
func (Duration) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
Marshals a Duration into a duration string.
func (*Duration) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
Unmarshals a JSON entry into the underlying type. The entry is expected to contain a string corresponding to one of the enum's keys.
type Time ¶
Time is a flag- and JSON-compatible Time which parses from RFC3339 strings.
func (Time) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
Marshals a Time into an RFC3339 time string.
func (*Time) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
Unmarshals a JSON entry into the underlying type. The entry is expected to contain a string corresponding to one of the enum's keys.