adapters

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockCVEAdapter

type MockCVEAdapter struct {
}

MockCVEAdapter implements a mocked CVEScanner to be used for tests

func NewMockCVEAdapter

func NewMockCVEAdapter() *MockCVEAdapter

NewMockCVEAdapter initializes the MockCVEAdapter struct

func (MockCVEAdapter) CreateRelevantCVE

func (m MockCVEAdapter) CreateRelevantCVE(_ context.Context, cve, _ domain.CVEManifest) (domain.CVEManifest, error)

CreateRelevantCVE returns the first CVE manifest (no combination performed)

func (MockCVEAdapter) DBVersion

func (m MockCVEAdapter) DBVersion() string

DBVersion returns a static version

func (MockCVEAdapter) Ready

func (m MockCVEAdapter) Ready() bool

Ready always returns true

func (MockCVEAdapter) ScanSBOM

func (m MockCVEAdapter) ScanSBOM(ctx context.Context, sbom domain.SBOM) (domain.CVEManifest, error)

ScanSBOM returns a dummy CVE manifest tagged with the given SBOM metadata

func (MockCVEAdapter) UpdateDB

func (m MockCVEAdapter) UpdateDB(ctx context.Context) error

UpdateDB does nothing (only otel span)

func (MockCVEAdapter) Version

func (m MockCVEAdapter) Version() string

Version returns a static version

type MockPlatform

type MockPlatform struct {
}

MockPlatform implements a mocked Platform to be used for tests

func NewMockPlatform

func NewMockPlatform() *MockPlatform

NewMockPlatform initializes the MockPlatform struct

func (MockPlatform) SendStatus

func (m MockPlatform) SendStatus(workload domain.ScanCommand, step int) error

SendStatus logs the given status and details

func (MockPlatform) SubmitCVE

func (m MockPlatform) SubmitCVE(cve domain.CVEManifest) error

SubmitCVE logs the given ImageID for CVE calculation

type MockSBOMAdapter

type MockSBOMAdapter struct {
}

MockSBOMAdapter implements a mocked SBOMCreator to be used for tests

func NewMockSBOMAdapter

func NewMockSBOMAdapter() *MockSBOMAdapter

NewMockSBOMAdapter initializes the MockSBOMAdapter struct

func (MockSBOMAdapter) CreateSBOM

func (m MockSBOMAdapter) CreateSBOM(ctx context.Context, imageID string, _ domain.RegistryOptions) (domain.SBOM, error)

CreateSBOM returns a dummy SBOM for the given imageID

func (MockSBOMAdapter) Version

func (m MockSBOMAdapter) Version() string

Version returns a static version

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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