Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Durafmt ¶
type Durafmt struct {
// contains filtered or unexported fields
}
Durafmt holds the parsed duration and the original input duration.
func ParseShort ¶
ParseShort creates a new *Durafmt struct, short form, returns error if input is invalid. It's shortcut for `Parse(dur).LimitFirstN(1)`
func ParseString ¶
ParseString creates a new *Durafmt struct from a string. returns an error if input is invalid.
func ParseStringShort ¶
ParseStringShort creates a new *Durafmt struct from a string, short form returns an error if input is invalid. It's shortcut for `ParseString(durStr)` and then calling `LimitFirstN(1)`
func (*Durafmt) LimitFirstN ¶
LimitFirstN sets the output format, outputing only first N elements. n == 0 means no limit.
func (*Durafmt) LimitToUnit ¶
LimitToUnit sets the output format, you will not have unit bigger than the UNIT specified. UNIT = "" means no restriction.