cooldown

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package cooldown withholds module versions that were published too recently.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseDuration

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

ParseDuration parses a cooldown period. A bare number is a number of days; a number may also carry a d, h or m suffix.

Types

type Held

type Held struct {
	Name    string
	Version *semver.Version
	Age     time.Duration
}

Held is a module whose update was withheld entirely by the cooldown window.

func Filter

func Filter(mods []module.Module, window time.Duration, now time.Time, lookup Lookup) ([]module.Module, []Held)

Filter applies the cooldown window to mods. A module whose target version is too recent falls back to the greatest version old enough to satisfy the window. Modules with no such version, and modules whose versions can't be checked, are removed from the returned modules and reported as held back.

type Lookup

type Lookup func(name string, after *semver.Version) ([]VersionInfo, error)

Lookup reports the tagged versions of a module newer than after, in ascending order, together with their publish times.

type VersionInfo

type VersionInfo struct {
	Version *semver.Version
	Time    time.Time
}

VersionInfo is a candidate module version and the time it was published.

Jump to

Keyboard shortcuts

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