Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { EventType rules.EventType `json:"eventType"` RuleID rules.RuleID `json:"ruleID"` Objects []*unstructured.Unstructured `json:"objects"` // contains filtered or unexported fields }
Event struct holds all information related to an event.
type EventQueue ¶
type EventQueue struct { workqueue.DelayingInterface // contains filtered or unexported fields }
EventQueue wraps around the workqueue.DelayingInterface and provides additional functionality. Adds functionality to process and retry items if failed. TODO: Add persistence of the queue. Currently queue is lost in case of crash.
func New ¶
func New(executor QueueExecutor, queueOpts Opts) *EventQueue
New creates a New EventQueue and returns the pointer to it.
func (*EventQueue) StartQueueWorkerPool ¶
func (eq *EventQueue) StartQueueWorkerPool()
StartQueueWorkerPool will start a pool of workers to process queue items. Blocks until all workers have finished. The number of workers is determined by the workerCount parameter. Closing the queue will cause the queue to be drained and all workers to exit.
type Opts ¶
Opts holds the configuration options for the EventQueue. WorkerCount is the number of workers to start. MaxTryCount is the maximum number of times an item will be retried. RequeueDelay is the delay in seconds before an item is retried.
type QueueExecutor ¶
QueueExecutor all queue executors must implement this interface. Execute method will be called for each item in the queue.