Documentation
¶
Index ¶
- func ParseDurationWithDays(input string) (time.Duration, error)
- type DurationWithDays
- func (d DurationWithDays) Hours() float64
- func (d DurationWithDays) MarshalJSON() ([]byte, error)
- func (d DurationWithDays) MarshalText() ([]byte, error)
- func (d DurationWithDays) Milliseconds() int64
- func (d DurationWithDays) Minutes() float64
- func (d DurationWithDays) Nanoseconds() int64
- func (d DurationWithDays) Seconds() float64
- func (d *DurationWithDays) Set(s string) error
- func (d DurationWithDays) String() string
- func (DurationWithDays) Type() string
- func (d *DurationWithDays) UnmarshalJSON(b []byte) error
- func (d *DurationWithDays) UnmarshalText(text []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DurationWithDays ¶ added in v0.0.19
DurationWithDays wraps time.Duration and supports parsing with "d" for days.
func (DurationWithDays) Hours ¶ added in v0.0.19
func (d DurationWithDays) Hours() float64
Hours returns the duration as a floating point number of hours.
func (DurationWithDays) MarshalJSON ¶ added in v0.0.19
func (d DurationWithDays) MarshalJSON() ([]byte, error)
MarshalJSON outputs a quoted string.
func (DurationWithDays) MarshalText ¶ added in v0.0.19
func (d DurationWithDays) MarshalText() ([]byte, error)
MarshalText returns the standard duration string.
func (DurationWithDays) Milliseconds ¶ added in v0.0.19
func (d DurationWithDays) Milliseconds() int64
Milliseconds returns the duration as an integer millisecond count.
func (DurationWithDays) Minutes ¶ added in v0.0.19
func (d DurationWithDays) Minutes() float64
Minutes returns the duration as a floating point number of minutes.
func (DurationWithDays) Nanoseconds ¶ added in v0.0.19
func (d DurationWithDays) Nanoseconds() int64
Nanoseconds returns the duration as an integer nanosecond count.
func (DurationWithDays) Seconds ¶ added in v0.0.19
func (d DurationWithDays) Seconds() float64
Seconds returns the duration as a floating point number of seconds.
func (*DurationWithDays) Set ¶ added in v0.0.19
func (d *DurationWithDays) Set(s string) error
Set implements the pflag.Value interface.
func (DurationWithDays) String ¶ added in v0.0.19
func (d DurationWithDays) String() string
String returns the standard time.Duration string.
func (DurationWithDays) Type ¶ added in v0.0.19
func (DurationWithDays) Type() string
Type returns the type name for Cobra flags.
func (*DurationWithDays) UnmarshalJSON ¶ added in v0.0.19
func (d *DurationWithDays) UnmarshalJSON(b []byte) error
UnmarshalJSON expects a quoted duration string like "2d3h".
func (*DurationWithDays) UnmarshalText ¶ added in v0.0.19
func (d *DurationWithDays) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler (used by YAML/JSON libs).