expiry

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 5 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 expiry is the pure expiry-policy engine. A keypair does not self-expire; this computes the policy reminder (per key: expires_on, days_remaining, state).

Index

Constants

View Source
const (
	OK      = "ok"
	DueSoon = "due_soon"
	Overdue = "overdue"
	Unknown = "unknown"
)

State values.

Variables

This section is empty.

Functions

func BannerLines

func BannerLines(states []Status) []string

BannerLines is one warning line per due/overdue key - the inline reminder.

func Cadence

func Cadence(states []Status) string

Cadence is "daily" once any key needs attention, else "weekly".

Types

type Status

type Status struct {
	Fingerprint   string
	KeyName       string
	Profile       string
	Created       *string
	ExpiresOn     *string
	DaysRemaining *int
	State         string
}

Status is one key's expiry policy state.

func ComputeStates

func ComputeStates(inv *inventory.Inventory, warnBeforeDays []int, today time.Time) []Status

ComputeStates returns per-key expiry status, most-urgent first. today should be a date (UTC midnight); warnBeforeDays is the manifest's warn thresholds.

func (Status) NeedsAttention

func (s Status) NeedsAttention() bool

NeedsAttention is true for due_soon/overdue keys.

func (Status) Ref

func (s Status) Ref() string

Ref is how to name this key unambiguously: "profile/key". KeyName alone is only unique within a profile, so it is a label, not an identifier.

Jump to

Keyboard shortcuts

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