ospkg

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 16 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnsupportedOS defines error for unsupported OS
	ErrUnsupportedOS = xerrors.New("unsupported os")

	// SuperSet binds dependencies for OS scan
	SuperSet = wire.NewSet(
		wire.Struct(new(Detector)),
		wire.Bind(new(Operation), new(Detector)),
	)
)

Functions

This section is empty.

Types

type DetectExpectation

type DetectExpectation struct {
	Args       DetectInput
	ReturnArgs DetectOutput
}

type DetectInput

type DetectInput struct {
	ImageName string
	OSFamily  string
	OSName    string
	Created   time.Time
	Pkgs      []ftypes.Package
}

type DetectOutput

type DetectOutput struct {
	Vulns []types.DetectedVulnerability
	Eosl  bool
	Err   error
}

type Detector

type Detector struct{}

Detector implements Operation

func (Detector) Detect

func (d Detector) Detect(_, osFamily, osName string, _ time.Time, pkgs []ftypes.Package) ([]types.DetectedVulnerability, bool, error)

Detect detects the vulnerabilities

type Driver

type Driver interface {
	Detect(string, []ftypes.Package) ([]types.DetectedVulnerability, error)
	IsSupportedVersion(string, string) bool
}

Driver defines operations for OS package scan

type MockDetector

type MockDetector struct {
	mock.Mock
}

func NewMockDetector

func NewMockDetector(detectExpectations []DetectExpectation) *MockDetector

func (*MockDetector) Detect

type Operation

type Operation interface {
	Detect(string, string, string, time.Time, []ftypes.Package) ([]types.DetectedVulnerability, bool, error)
}

Operation defines operation of OSpkg scan

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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