queue

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

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

Jump to

Keyboard shortcuts

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