worker

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	RetryAttempts int
	RetryBackoff  time.Duration
}

Config contains configuration for the worker

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns default worker configuration

type ImageWorker

type ImageWorker struct {
	// contains filtered or unexported fields
}

ImageWorker implements the Worker interface

func NewImageWorker

func NewImageWorker(
	queue queue.TaskQueue,
	scanner scanner.Scanner,
	policy policy.PolicyEngine,
	attestor attestation.Attestor,
	registry registry.Client,
	stateStore statestore.StateStore,
	config Config,
	logger *slog.Logger,
	regsyncCfg *config.RegsyncConfig,
) *ImageWorker

NewImageWorker creates a new worker instance

func (*ImageWorker) ProcessTask

func (w *ImageWorker) ProcessTask(ctx context.Context, task *queue.ScanTask) error

ProcessTask executes the complete workflow for one image with retry logic

func (*ImageWorker) Start

func (w *ImageWorker) Start(ctx context.Context) error

Start begins processing tasks from the queue

type Pipeline

type Pipeline struct {
	// contains filtered or unexported fields
}

Pipeline orchestrates the complete scan workflow

func NewPipeline

func NewPipeline(worker *ImageWorker, logger *slog.Logger) *Pipeline

NewPipeline creates a new pipeline instance

func (*Pipeline) Execute

func (p *Pipeline) Execute(ctx context.Context, task *queue.ScanTask) error

Execute runs the complete scan workflow for a single image

type Worker

type Worker interface {
	// Start begins processing tasks from the queue
	Start(ctx context.Context) error

	// ProcessTask executes the complete workflow for one image
	ProcessTask(ctx context.Context, task *queue.ScanTask) error
}

Worker defines the interface for processing scan tasks

Jump to

Keyboard shortcuts

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