cooldown

package
v0.2.42 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package cooldown implements per-profile rate limiting for notifications.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(profile, action string, cooldownSeconds int) bool

Check returns true if the given profile/action is still within its cooldown window. A missing or unreadable state file is treated as "not on cooldown" (fail-open: if checking fails, notifications are allowed through rather than blocked, so a corrupt state file never silences alerts).

func Record

func Record(profile, action string)

Record writes the current timestamp for the given profile/action. Errors are printed to stderr but never fatal (best-effort).

Types

This section is empty.

Jump to

Keyboard shortcuts

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