scanner

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTransformer

func NewTransformer() *transformer

Types

type Adapter

type Adapter interface {
	// Scan adapts a Harbor ScanRequest to Clair API calls and then maps the response Clair layer to Harbor ScanReport.
	// Returns error in case of failures.
	Scan(req harbor.ScanRequest) (harbor.ScanReport, error)
}

Adapter wraps the Scan method.

func NewAdapter

func NewAdapter(registryClientFactory registry.ClientFactory, clairClient clair.Client, transformer Transformer) Adapter

type Enqueuer

type Enqueuer interface {
	Enqueue(request harbor.ScanRequest) (string, error)
}

Enqueuer wraps the Enqueue method. Enqueue enqueues the specify ScanRequest for async processing and returns the async job's identifier.

func NewEnqueuer

func NewEnqueuer(pool *work.Pool, adapter Adapter, store persistence.Store) Enqueuer

NewEnqueuer constructs the default Enqueuer.

type Transformer

type Transformer interface {
	ToClairLayers(req harbor.ScanRequest, manifest distribution.Manifest) []clair.Layer
	ToHarborScanReport(artifact harbor.Artifact, layer *clair.Layer) harbor.ScanReport
}

Jump to

Keyboard shortcuts

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