Files
trivy/internal/client/wire_gen.go
Teppei Fukuda 4189855fc1 fix(cache): specify a directory to store image cache (#341)
* 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
2019-12-26 16:08:08 +02:00

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
}