github.com/quay/claircore@v1.5.28/libindex/options.go (about) 1 package libindex 2 3 import ( 4 "time" 5 6 "github.com/quay/claircore/indexer" 7 ) 8 9 const ( 10 DefaultScanLockRetry = 5 * time.Second 11 DefaultLayerScanConcurrency = 10 12 ) 13 14 // Options are dependencies and options for constructing an instance of libindex 15 type Options struct { 16 // Store is the interface used to persist and retrieve results of indexing. 17 Store indexer.Store 18 // Locker provides system-wide locks. If the indexing work is distributed the 19 // lock should be backed by a distributed store. 20 Locker LockSource 21 // FetchArena is an interface tied to the lifecycle of LibIndex to enable management 22 // of the filesystem while separate processes are dealing with layers, for example: 23 // you can reference count downloaded layer files to avoid racing. 24 FetchArena indexer.FetchArena 25 // ScanLockRetry specifies how often we should try to acquire a lock for scanning a 26 // given manifest if lock is taken. 27 ScanLockRetry time.Duration 28 // LayerScanConcurrency specifies the number of layers to be scanned in parallel. 29 LayerScanConcurrency int 30 // LayerFetchOpt is unused and kept here for backwards compatibility. 31 LayerFetchOpt interface{} 32 // NoLayerValidation controls whether layers are checked to actually be 33 // content-addressed. With this option toggled off, callers can trigger 34 // layers to be indexed repeatedly by changing the identifier in the 35 // manifest. 36 NoLayerValidation bool 37 // ControllerFactory provides an alternative method for creating a scanner during libindex runtime 38 // if nil the default factory will be used. useful for testing purposes 39 ControllerFactory ControllerFactory 40 // Ecosystems a list of ecosystems to use which define which package databases and coalescing methods we use 41 Ecosystems []*indexer.Ecosystem 42 // ScannerConfig holds functions that can be passed into configurable 43 // scanners. They're broken out by kind, and only used if a scanner 44 // implements the appropriate interface. 45 // 46 // Providing a function for a scanner that's not expecting it is not a fatal 47 // error. 48 ScannerConfig struct { 49 Package, Dist, Repo, File map[string]func(interface{}) error 50 } 51 Resolvers []indexer.Resolver 52 }