cooldownpolicy

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package cooldownpolicy applies package-pattern overrides to cooldown checks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Policy

type Policy struct {
	// contains filtered or unexported fields
}

Policy applies exact PURL overrides before package-pattern overrides.

func New

func New(base *cooldown.Config, packagePatterns map[string]string) (*Policy, error)

New creates a Policy using the supplied exact and pattern overrides.

func (*Policy) Enabled

func (p *Policy) Enabled() bool

Enabled reports whether any configured cooldown can filter a package version.

func (*Policy) Evaluate

func (p *Policy) Evaluate(ecosystem, packagePURL string, publishedAt, evaluatedAt time.Time) cooldown.Decision

Evaluate returns the cooldown decision at the supplied evaluation time.

func (*Policy) For

func (p *Policy) For(ecosystem, packagePURL string) time.Duration

For returns the duration, with exact overrides taking precedence over patterns.

func (*Policy) IsAllowed

func (p *Policy) IsAllowed(ecosystem, packagePURL string, publishedAt time.Time) bool

IsAllowed reports whether the package version has completed its cooldown.

Jump to

Keyboard shortcuts

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