mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-10 14:50:50 -08:00
* chore(mod): update dependencies * fix(scanner): make scanner take a cache client as the argument * refactor: sort imports * refactor(cache): create a struct to clear cache * fix(cache): use a struct to clear cache * fix(wire): update constructor to take cache struct * fix(cache): use the constructor generated by wire * docs(cli): update the option description * fix(cache): use the cache struct * fix(cache): split Reset into ClearDB and ClearImages
37 lines
1.3 KiB
Go
37 lines
1.3 KiB
Go
// Code generated by Wire. DO NOT EDIT.
|
|
|
|
//go:generate wire
|
|
//+build !wireinject
|
|
|
|
package client
|
|
|
|
import (
|
|
"github.com/aquasecurity/fanal/cache"
|
|
"github.com/aquasecurity/trivy-db/pkg/db"
|
|
"github.com/aquasecurity/trivy/pkg/rpc/client/library"
|
|
"github.com/aquasecurity/trivy/pkg/rpc/client/ospkg"
|
|
"github.com/aquasecurity/trivy/pkg/scanner"
|
|
library2 "github.com/aquasecurity/trivy/pkg/scanner/library"
|
|
ospkg2 "github.com/aquasecurity/trivy/pkg/scanner/ospkg"
|
|
"github.com/aquasecurity/trivy/pkg/vulnerability"
|
|
)
|
|
|
|
// Injectors from inject.go:
|
|
|
|
func initializeScanner(cacheClient cache.Cache, ospkgCustomHeaders ospkg.CustomHeaders, libraryCustomHeaders library.CustomHeaders, ospkgURL ospkg.RemoteURL, libURL library.RemoteURL) scanner.Scanner {
|
|
osDetector := ospkg.NewProtobufClient(ospkgURL)
|
|
detector := ospkg.NewDetector(ospkgCustomHeaders, osDetector)
|
|
ospkgScanner := ospkg2.NewScanner(detector)
|
|
libDetector := library.NewProtobufClient(libURL)
|
|
libraryDetector := library.NewDetector(libraryCustomHeaders, libDetector)
|
|
libraryScanner := library2.NewScanner(libraryDetector)
|
|
scannerScanner := scanner.NewScanner(cacheClient, ospkgScanner, libraryScanner)
|
|
return scannerScanner
|
|
}
|
|
|
|
func initializeVulnerabilityClient() vulnerability.Client {
|
|
config := db.Config{}
|
|
client := vulnerability.NewClient(config)
|
|
return client
|
|
}
|