Documentation
¶
Overview ¶
Package runner executes scan runs from a queue with a fixed number of workers and stores their results.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrQueueFull = errors.New("run queue is full")
ErrQueueFull is returned when too many runs are waiting.
Functions ¶
This section is empty.
Types ¶
type IgnoreFunc ¶
IgnoreFunc returns the ignore rules in effect. On an error the rules it still returns are applied; everything else counts.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner queues and executes runs.
func New ¶
func New(st *store.Store, sc *scan.Scanner, workers int, timeout time.Duration, log *slog.Logger) *Runner
New returns a runner. Call Start to process the queue.
func (*Runner) Enqueue ¶
func (r *Runner) Enqueue(ctx context.Context, sc *store.Scan, ref, platforms, trigger string) (*store.Run, error)
Enqueue creates a queued run of ref. sc is the configured scan, or nil for an ad-hoc run.
func (*Runner) SetIgnore ¶
func (r *Runner) SetIgnore(fn IgnoreFunc)
SetIgnore sets the source of ignore rules; call it before Start.
Click to show internal directories.
Click to hide internal directories.