state

package
v0.0.0-...-0145ae5 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionState

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

func NewState

func NewState() *ActionState

func (*ActionState) Add

func (s *ActionState) Add(countermeasure *v1alpha1.CounterMeasure) error

Add adds a new CounterMeasure entry

func (*ActionState) CounterMeasureEnd

func (s *ActionState) CounterMeasureEnd(event events.Event, key manager.ObjectKey)

CounterMeasureEnd record that a Countermeasure has ended.

func (*ActionState) CounterMeasureStart

func (s *ActionState) CounterMeasureStart(event events.Event, key manager.ObjectKey)

CounterMeasureStart record the start of a countermeasure for an event.

func (*ActionState) GetCounterMeasure

func (s *ActionState) GetCounterMeasure(key manager.ObjectKey) *Entry

GetCounterMeasures return all CounterMeasure entries that subscribe to the named event.

func (*ActionState) IsDeployed

func (s *ActionState) IsDeployed(key manager.ObjectKey) bool

IsDeployed is the countermeasure with this ObjectKey deployed, this will check the Generation as well for the exact version.

func (*ActionState) IsRunning

func (s *ActionState) IsRunning(key manager.ObjectKey) bool

func (*ActionState) Remove

func (s *ActionState) Remove(name types.NamespacedName) error

Remove delete a CounterMeasure using the NamespaceName

type ActiveCounterMeasures

type ActiveCounterMeasures map[manager.ObjectKey]*Entry

type Entry

type Entry struct {
	sync.Mutex

	Name           string
	Countermeasure *v1alpha1.CounterMeasure
	// contains filtered or unexported fields
}

func (*Entry) IsSuppressed

func (e *Entry) IsSuppressed(event events.Event) bool

type RunningSet

type RunningSet map[manager.ObjectKey]struct{}

Jump to

Keyboard shortcuts

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