duration

package
v2.7.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Day  = 24 * time.Hour
	Week = 7 * Day
)

Variables

View Source
var (
	ErrInvalidUnit = errors.New("duration must be week(w), day(d), hour(h), min(m), sec(s), millisec(ms), microsec(us), or nanosec(ns)")
	ErrInvalidRune = errors.New("invalid rune in declaration")
)

Functions

func RawDurationToTimeDuration

func RawDurationToTimeDuration(raw string) (time.Duration, error)

RawDurationToTimeDuration extends the builtin duration-parser to support days(d) and weeks(w) as parseable units. The core implementation is copied from InfluxDB OSS's task engine, which itself copied the logic from an internal module in Flux.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL