Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventType ¶ added in v0.17.0
type EventType string
EventType is the type of an event.
const ( // EventTypeUpdated is emitted whenever data of an image is updated. EventTypeUpdated EventType = "updated" // EventTypeProcessed is emitted whenever an image was processed. EventTypeProcessed EventType = "processed" // EventTypeNewVersionAvailable is emitted whenever the latest available // version of an image changes. EventTypeNewVersionAvailable EventType = "newVersionAvailable" )
type Queue ¶ added in v0.17.0
type Queue[T comparable] struct { // contains filtered or unexported fields }
Queue is a queue data structure implementation useful for tracking jobs. It enables multiple producers to queue items for multiple consumers. Consumers will sleep whilst they're waiting for jobs. The implementation also provides token bucket-based rate limiting.
func NewQueue ¶ added in v0.17.0
func NewQueue[T comparable](burst int, tick time.Duration) *Queue[T]
NewQueue returns a new Queue. An initialized queue should be closed by calling Queue.Close
- burst controls the target number of items that can be taken from the queue.
- tick is the target mean time between items being taken from the queue.
func (*Queue[T]) AvailableBurst ¶ added in v0.17.0
AvailableBurst returns the number of items that could currently be taken from the queue without being rate limited.
func (*Queue[T]) Close ¶ added in v0.17.0
func (q *Queue[T]) Close()
Close closes the queue and frees resources. Closing a queue will wake any waiting consumer and exit their pull loops. Continuing to use a closed queue will panic.
func (*Queue[T]) Collect ¶ added in v0.17.0
func (w *Queue[T]) Collect(ch chan<- prometheus.Metric)
Collect implements prometheus.Collector.
func (*Queue[T]) Describe ¶ added in v0.17.0
func (w *Queue[T]) Describe(descs chan<- *prometheus.Desc)
Describe implements prometheus.Collector.
type Worker ¶
Worker processes raw container image entries, running the image workflow and storing the result to the state store. The worker produces events of the type Event.
func (*Worker) Collect ¶
func (w *Worker) Collect(ch chan<- prometheus.Metric)
Collect implements prometheus.Collector.
func (*Worker) Describe ¶
func (w *Worker) Describe(descs chan<- *prometheus.Desc)
Describe implements prometheus.Collector.