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