scan

package
v0.0.0-...-44f477e Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// JobParamRegistration ...
	JobParamRegistration = "registration"
	// JobParameterRequest ...
	JobParameterRequest = "scanRequest"
	// JobParameterMimes ...
	JobParameterMimes = "mimeTypes"
	// JobParameterAuthType ...
	JobParameterAuthType = "authType"
	// JobParameterRobot ...
	JobParameterRobot = "robotAccount"
)

Variables

This section is empty.

Functions

func EnsureDefaultScanner

func EnsureDefaultScanner(ctx context.Context, scannerName string) (err error)

EnsureDefaultScanner ensures that the scanner with the specified URL is set as default in the system.

func EnsureScanners

func EnsureScanners(ctx context.Context, wantedScanners []scanner.Registration) (err error)

EnsureScanners ensures that the scanners with the specified endpoints URLs exist in the system.

func ExtractScanReq

func ExtractScanReq(params job.Parameters) (*v1.ScanRequest, error)

ExtractScanReq extracts the scan request from the job parameters.

func RemoveImmutableScanners

func RemoveImmutableScanners(ctx context.Context, names []string) error

RemoveImmutableScanners removes immutable scanner Registrations with the specified endpoint URLs.

Types

type CheckInReport

type CheckInReport struct {
	Digest           string `json:"digest"`
	RegistrationUUID string `json:"registration_uuid"`
	MimeType         string `json:"mime_type"`
	RawReport        string `json:"raw_report"`
}

CheckInReport defines model for checking in the scan report with specified mime.

func (*CheckInReport) FromJSON

func (cir *CheckInReport) FromJSON(jsonData string) error

FromJSON parse json to CheckInReport

func (*CheckInReport) ToJSON

func (cir *CheckInReport) ToJSON() (string, error)

ToJSON marshal CheckInReport to JSON

type Job

type Job struct{}

Job for running scan in the job service with async way

func (*Job) MaxCurrency

func (j *Job) MaxCurrency() uint

MaxCurrency is implementation of same method in Interface.

func (*Job) MaxFails

func (j *Job) MaxFails() uint

MaxFails for defining the number of retries

func (*Job) Run

func (j *Job) Run(ctx job.Context, params job.Parameters) error

Run the job

func (*Job) ShouldRetry

func (j *Job) ShouldRetry() bool

ShouldRetry indicates if the job should be retried

func (*Job) Validate

func (j *Job) Validate(params job.Parameters) error

Validate the parameters of this job

Directories

Path Synopsis
dao
rest
v1

Jump to

Keyboard shortcuts

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