scan

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock interface {
	Now() time.Time
}

Clock wraps the Now method. Introduced to allow replacing the global state with fixed clocks to facilitate testing. Now returns the current time.

type Controller

type Controller interface {
	Scan(ctx context.Context, scanJobKey job.ScanJobKey, request *harbor.ScanRequest) error
}

func NewController

func NewController(store persistence.Store, wrapper trivy.Wrapper, transformer Transformer) Controller

type SystemClock

type SystemClock struct {
}

func (*SystemClock) Now

func (c *SystemClock) Now() time.Time

type Transformer

type Transformer interface {
	Transform(mediaType api.MediaType, req harbor.ScanRequest, source trivy.Report) harbor.ScanReport
}

Transformer wraps the Transform method. Transform transforms Trivy's scan report into Harbor's packages vulnerabilities report.

func NewTransformer

func NewTransformer(clock Clock) Transformer

NewTransformer constructs a Transformer with the given Clock.

Jump to

Keyboard shortcuts

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