scanner

package
v0.0.0-...-d9b97d9 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package scanner holds scanner related files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetGlobalScanner

func SetGlobalScanner(s *Scanner)

SetGlobalScanner sets a global instance of the SBOM scanner. It should be used only for testing purposes.

Types

type Scanner

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

Scanner defines the scanner

func CreateGlobalScanner

func CreateGlobalScanner(cfg config.Component, wmeta optional.Option[workloadmeta.Component]) (*Scanner, error)

CreateGlobalScanner creates a SBOM scanner, sets it as the default global one, and returns it. Start() needs to be called before any data collection happens.

func GetGlobalScanner

func GetGlobalScanner() *Scanner

GetGlobalScanner returns a global instance of the SBOM scanner. It does not create one if it's not already set (see CreateGlobalScanner) and returns nil in that case.

func NewScanner

func NewScanner(cfg config.Component, collectors map[string]collectors.Collector, wmeta optional.Option[workloadmeta.Component]) *Scanner

NewScanner creates a new SBOM scanner. Call Start to start the store and its collectors.

func (*Scanner) GetCollector

func (s *Scanner) GetCollector(collector string) collectors.Collector

GetCollector returns the collector with the specified name

func (*Scanner) PerformScan

func (s *Scanner) PerformScan(ctx context.Context, request sbom.ScanRequest, collector collectors.Collector) *sbom.ScanResult

PerformScan processes a scan request with the selected collector and returns the SBOM

func (*Scanner) Scan

func (s *Scanner) Scan(request sbom.ScanRequest) error

Scan enqueues a scan request to the scanner

func (*Scanner) Start

func (s *Scanner) Start(ctx context.Context)

Start starts the scanner

Jump to

Keyboard shortcuts

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