duration

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package duration parses the duration shape docsync writes in directives and in configuration: an integer followed by a unit.

It lives here, below both, because two callers need the same grammar and neither should import the other for it: the directive verbs read `expires=` and `review_every=`, and `[check] snapshot_max_age` reads the same shape. A config package that had to import the checker to validate one key would pull the whole evaluation tree behind a leaf.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(s string) (time.Duration, error)

Parse reads an integer followed by d (days), w (weeks), h (hours), or m (minutes). Months and years are not offered because their length is ambiguous; write 90d, not 3m.

Types

This section is empty.

Jump to

Keyboard shortcuts

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