adapters

package
v0.3.18 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 11 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) DBVersion

func (m MockCVEAdapter) DBVersion(context.Context) string

DBVersion returns a static version

func (MockCVEAdapter) Ready

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) Version

func (m MockCVEAdapter) Version(_ context.Context) string

Version returns a static version

type MockPlatform

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

MockPlatform implements a mocked Platform to be used for tests

func NewMockPlatform

func NewMockPlatform(wantEmptyReport bool) *MockPlatform

NewMockPlatform initializes the MockPlatform struct

func (MockPlatform) GetCVEExceptions added in v0.2.99

func (m MockPlatform) GetCVEExceptions(ctx context.Context) (domain.CVEExceptions, error)

GetCVEExceptions returns an empty CVEExceptions

func (MockPlatform) ReportError added in v0.3.14

func (m MockPlatform) ReportError(ctx context.Context, _ error) error

func (MockPlatform) SendStatus

func (m MockPlatform) SendStatus(ctx context.Context, _ int) error

SendStatus logs the given status and details

func (MockPlatform) SubmitCVE

SubmitCVE logs the given ID for CVE calculation

type MockSBOMAdapter

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

MockSBOMAdapter implements a mocked SBOMCreator to be used for tests

func NewMockSBOMAdapter

func NewMockSBOMAdapter(error, timeout, toomanyrequests bool) *MockSBOMAdapter

NewMockSBOMAdapter initializes the MockSBOMAdapter struct

func (MockSBOMAdapter) CreateSBOM

func (m MockSBOMAdapter) CreateSBOM(_ context.Context, name, imageID, imageTag 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