Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrQueueEmpty is returned when the queue is empty ErrQueueEmpty = fmt.Errorf("rule queue is empty") )
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
// Rule is the rule object that allows to perform rule operations
Rule rule.Rule
// LastCheckTime is the last time a check on the conditions for the rule was
// made
LastCheckTime time.Time
// FSM is the state machine for the rule
FSM *fsm.FSM
// Spec is the autopilot rule corresponding to the object
// for which this entry was made
Spec v1alpha1.AutopilotRule
}
Entry represents one item in the queue
type RuleQueue ¶
type RuleQueue interface {
// Enqueue adds an entry at the back of the queue
Enqueue(e *Entry)
// Dequeue removes an entry from the front of the queue
Dequeue() (*Entry, error)
// GetByRule removes the given entry from the queue
GetByUUID(uuid string) (*Entry, error)
// DequeueByRule removes the given entry from the queue
DequeueByUUID(uuid string) (*Entry, error)
// Len returns the current length of the queue
Len() int
}
RuleQueue is an interface to access rules in the system using a queue
func NewRuleQueue ¶
func NewRuleQueue() RuleQueue
NewRuleQueue creates a new queue for storing and accessing rules
Click to show internal directories.
Click to hide internal directories.