Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlignPrecision ¶
AlignPrecision aligns the two time strings to same precision by truncating the more precise one
func BeforeChain ¶
func BeforeChain(beforeFunctions []cli.BeforeFunc) cli.BeforeFunc
BeforeChain is a convenient function to chain up multiple cli.BeforeFunc
func DurationInterceptor ¶
DurationInterceptor sets the duration if absent, and formats it accordingly, see ParseDuration
func ParseDuration ¶
ParseDuration parses the `start` and `end` to a triplet, (startTime, endTime, step) if --start and --end are both absent,
then: start := now - 30min; end := now
if --start is given, --end is absent,
then: end := now + 30 units, where unit is the precision of `start`, (hours, minutes, etc.)
if --start is absent, --end is given,
then: start := end - 30 unis, where unit is the precision of `end`, (hours, minutes, etc.)
NOTE that when either(both) `start` or `end` is(are) given, there is no timezone info in the format, (e.g. 2019-11-09 1001), so they'll be considered as UTC-based, and generate the missing `start`(`end`) based on the same timezone, UTC
Types ¶
This section is empty.