Documentation
¶
Overview ¶
Package cooldown enforces a minimum delay between destructive operations on a per-profile basis, protecting against runaway automation.
Default delay is 10 seconds. Per-profile overrides are read from the config (destructive-cooldown field on the Profile struct). Setting the value to 0 disables the cooldown for that profile. Passing noInput=true always skips the cooldown regardless of config, so CI/CD pipelines are never affected.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Enforce ¶
Enforce checks whether a cooldown period has elapsed since the last destructive operation for profileName. If not, it sleeps for the remaining duration, printing a message to stderr.
Rules:
- noInput=true → always returns nil immediately (CI/CD bypass)
- configured != nil && *configured == 0 → returns nil (explicitly disabled)
- configured == nil → uses defaultCooldown (10s)
- otherwise → uses *configured
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.