Help us shape the future of Go! Take the 2026 Go Developer Survey

rulecooldown

package
v0.3.310 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RuleCooldown

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

func NewRuleCooldown

func NewRuleCooldown(config RuleCooldownConfig) *RuleCooldown

func (*RuleCooldown) ShouldCooldown

func (rc *RuleCooldown) ShouldCooldown(uniqueID string, containerID string, ruleID string) (bool, int)

type RuleCooldownConfig

type RuleCooldownConfig struct {
	// Disabled is the master kill-switch for rule cooldown. When true, cooldown is
	// bypassed entirely regardless of the other fields. Zero value (false) preserves
	// the historical behavior of being governed by OnProfileFailure.
	Disabled           bool          `mapstructure:"ruleCooldownDisabled"`
	CooldownDuration   time.Duration `mapstructure:"ruleCooldownDuration"`
	CooldownAfterCount int           `mapstructure:"ruleCooldownAfterCount"`
	// Deprecated: retained for backward compatibility. Setting it false still disables
	// cooldown, but new callers should use Disabled as the explicit master switch.
	OnProfileFailure bool `mapstructure:"ruleCooldownOnProfileFailure"`
	MaxSize          int  `mapstructure:"ruleCooldownMaxSize"`
}

Jump to

Keyboard shortcuts

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