duration

package
v1.37.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package duration reads the durations a workflow is written with: a step's timeout and wait, the interval of a repeat or a retry, and the timeout an action takes. A duration is a Go duration string such as "30s" or "1m30s", or a number of seconds, which may have a fraction, such as 1.5.

Index

Constants

View Source
const MaxSeconds = math.MaxInt64 / int64(time.Second)

MaxSeconds is the most whole seconds a time.Duration can hold, about 292 years.

Variables

This section is empty.

Functions

func Parse

func Parse(v any) (time.Duration, error)

Parse reads v as a duration: a time.Duration, a duration string, a number of seconds, or a string of one, with the spaces around it ignored. Zero is a duration; whether it means none, no limit or the default is for the caller to say. Parse refuses a negative value, one too long for a time.Duration rather than wrapping it around to another, and one above zero but below a nanosecond. A fraction of a second is rounded to the nearest nanosecond, so that 4.1, which as a float is a little below 4.1, is 4.1s and not a nanosecond less. The error says why, and not what v was, so that the caller can name the field.

Types

This section is empty.

Jump to

Keyboard shortcuts

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