Documentation ¶
Overview ¶
Package indexer is a generated GoMock package.
Package indexer is a generated GoMock package.
Package indexer is a generated GoMock package.
Package indexer is a generated GoMock package.
Package indexer is a generated GoMock package.
Package indexer is a generated GoMock package.
Package indexer is a generated GoMock package.
Package indexer is a generated GoMock package.
Index ¶
- Constants
- func EcosystemsToScanners(ctx context.Context, ecosystems []*Ecosystem) ([]PackageScanner, []DistributionScanner, []RepositoryScanner, error)
- type Coalescer
- type DistributionScanner
- type Ecosystem
- type Fetcher
- type LayerFetchOpt
- type LayerScanner
- type MockCoalescer
- type MockCoalescerMockRecorder
- type MockDistributionScanner
- func (m *MockDistributionScanner) EXPECT() *MockDistributionScannerMockRecorder
- func (m *MockDistributionScanner) Kind() string
- func (m *MockDistributionScanner) Name() string
- func (m *MockDistributionScanner) Scan(arg0 context.Context, arg1 *claircore.Layer) ([]*claircore.Distribution, error)
- func (m *MockDistributionScanner) Version() string
- type MockDistributionScannerMockRecorder
- type MockFetcher
- type MockFetcherMockRecorder
- type MockLayerScanner
- type MockLayerScannerMockRecorder
- type MockPackageScanner
- func (m *MockPackageScanner) EXPECT() *MockPackageScannerMockRecorder
- func (m *MockPackageScanner) Kind() string
- func (m *MockPackageScanner) Name() string
- func (m *MockPackageScanner) Scan(arg0 context.Context, arg1 *claircore.Layer) ([]*claircore.Package, error)
- func (m *MockPackageScanner) Version() string
- type MockPackageScannerMockRecorder
- type MockRepositoryScanner
- func (m *MockRepositoryScanner) EXPECT() *MockRepositoryScannerMockRecorder
- func (m *MockRepositoryScanner) Kind() string
- func (m *MockRepositoryScanner) Name() string
- func (m *MockRepositoryScanner) Scan(arg0 context.Context, arg1 *claircore.Layer) ([]*claircore.Repository, error)
- func (m *MockRepositoryScanner) Version() string
- type MockRepositoryScannerMockRecorder
- type MockStore
- func (m *MockStore) DistributionsByLayer(arg0 context.Context, arg1 string, arg2 VersionedScanners) ([]*claircore.Distribution, error)
- func (m *MockStore) EXPECT() *MockStoreMockRecorder
- func (m *MockStore) IndexDistributions(arg0 context.Context, arg1 []*claircore.Distribution, arg2 *claircore.Layer, ...) error
- func (m *MockStore) IndexPackages(arg0 context.Context, arg1 []*claircore.Package, arg2 *claircore.Layer, ...) error
- func (m *MockStore) IndexReport(arg0 context.Context, arg1 string) (*claircore.IndexReport, bool, error)
- func (m *MockStore) IndexRepositories(arg0 context.Context, arg1 []*claircore.Repository, arg2 *claircore.Layer, ...) error
- func (m *MockStore) LayerScanned(arg0 context.Context, arg1 string, arg2 VersionedScanner) (bool, error)
- func (m *MockStore) ManifestScanned(arg0 context.Context, arg1 string, arg2 VersionedScanners) (bool, error)
- func (m *MockStore) PackagesByLayer(arg0 context.Context, arg1 string, arg2 VersionedScanners) ([]*claircore.Package, error)
- func (m *MockStore) RegisterScanners(arg0 context.Context, arg1 VersionedScanners) error
- func (m *MockStore) RepositoriesByLayer(arg0 context.Context, arg1 string, arg2 VersionedScanners) ([]*claircore.Repository, error)
- func (m *MockStore) SetIndexFinished(arg0 context.Context, arg1 *claircore.IndexReport, arg2 VersionedScanners) error
- func (m *MockStore) SetIndexReport(arg0 context.Context, arg1 *claircore.IndexReport) error
- type MockStoreMockRecorder
- func (mr *MockStoreMockRecorder) DistributionsByLayer(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) IndexDistributions(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) IndexPackages(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) IndexReport(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) IndexRepositories(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) LayerScanned(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) ManifestScanned(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) PackagesByLayer(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) RegisterScanners(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) RepositoriesByLayer(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) SetIndexFinished(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) SetIndexReport(arg0, arg1 interface{}) *gomock.Call
- type MockVersionedScanner
- type MockVersionedScannerMockRecorder
- type Opts
- type PackageScanner
- type RepositoryScanner
- type Store
- type VersionedScanner
- type VersionedScanners
- func (vs *VersionedScanners) DStoVS(scnrs []DistributionScanner)
- func (vs *VersionedScanners) PStoVS(scnrs []PackageScanner)
- func (vs *VersionedScanners) RStoVS(scnrs []RepositoryScanner)
- func (vs VersionedScanners) VStoDS() []DistributionScanner
- func (vs VersionedScanners) VStoPS() []PackageScanner
- func (vs VersionedScanners) VStoRS() []RepositoryScanner
Constants ¶
const (
Package = "package"
)
Variables ¶
This section is empty.
Functions ¶
func EcosystemsToScanners ¶
func EcosystemsToScanners(ctx context.Context, ecosystems []*Ecosystem) ([]PackageScanner, []DistributionScanner, []RepositoryScanner, error)
EcosystemsToScanners extracts and dedupes multiple ecosystems and returns their discrete scanners
Types ¶
type Coalescer ¶
type Coalescer interface {
Coalesce(ctx context.Context, layers []*claircore.Layer) (*claircore.IndexReport, error)
}
Coalescer takes a set of layers and creates coalesced IndexReport.
A coalesced IndexReport should provide only the packages present in the final container image once all layers were applied.
type DistributionScanner ¶
type DistributionScanner interface { VersionedScanner Scan(context.Context, *claircore.Layer) ([]*claircore.Distribution, error) }
type Ecosystem ¶
type Ecosystem struct { Name string PackageScanners func(ctx context.Context) ([]PackageScanner, error) DistributionScanners func(ctx context.Context) ([]DistributionScanner, error) RepositoryScanners func(ctx context.Context) ([]RepositoryScanner, error) Coalescer func(ctx context.Context, store Store) (Coalescer, error) }
Ecosystems group together scanners and a Coalescer which are commonly used together.
A typical ecosystem is "DPKG" which will use the DPKG package indexer, the "OS-Release" distribution scanner and the "APT" repository scanner.
A Controller will scan layers with all scanners present in its configured ecosystems.
type Fetcher ¶
Fetcher is responsible for downloading a layer, uncompressing if ncessary, and making the uncompressed tar contents availble for reading.
type LayerFetchOpt ¶
type LayerFetchOpt string
LayerFetchOpt tells libindex where to store fetched layers
const ( // OnDisk - layers will be fetched via HTTP and writen to disk. When scanned the contents will be read from a fd. OnDisk LayerFetchOpt = "ondisk" // InMem - layers will be fetched via HTTP and writen to the layer's in memory byte array. When scanned the contents will be read from this in memory byte array InMem LayerFetchOpt = "inmem" // Tee - layers will be fetched via HTTP and written both the layer's in memory byte array and onto disk. Tee LayerFetchOpt = "tee" )
type LayerScanner ¶
type LayerScanner interface {
Scan(ctx context.Context, manifest string, layers []*claircore.Layer) error
}
LayerScanner is an interface for scanning a set of layer's contents and indexing discovered items into the persistence layer. scanning mechanics (concurrency, ordering, etc...) will be defined by implementations.
type MockCoalescer ¶
type MockCoalescer struct {
// contains filtered or unexported fields
}
MockCoalescer is a mock of Coalescer interface
func NewMockCoalescer ¶
func NewMockCoalescer(ctrl *gomock.Controller) *MockCoalescer
NewMockCoalescer creates a new mock instance
func (*MockCoalescer) Coalesce ¶
func (m *MockCoalescer) Coalesce(arg0 context.Context, arg1 []*claircore.Layer) (*claircore.IndexReport, error)
Coalesce mocks base method
func (*MockCoalescer) EXPECT ¶
func (m *MockCoalescer) EXPECT() *MockCoalescerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockCoalescerMockRecorder ¶
type MockCoalescerMockRecorder struct {
// contains filtered or unexported fields
}
MockCoalescerMockRecorder is the mock recorder for MockCoalescer
func (*MockCoalescerMockRecorder) Coalesce ¶
func (mr *MockCoalescerMockRecorder) Coalesce(arg0, arg1 interface{}) *gomock.Call
Coalesce indicates an expected call of Coalesce
type MockDistributionScanner ¶
type MockDistributionScanner struct {
// contains filtered or unexported fields
}
MockDistributionScanner is a mock of DistributionScanner interface
func NewMockDistributionScanner ¶
func NewMockDistributionScanner(ctrl *gomock.Controller) *MockDistributionScanner
NewMockDistributionScanner creates a new mock instance
func (*MockDistributionScanner) EXPECT ¶
func (m *MockDistributionScanner) EXPECT() *MockDistributionScannerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockDistributionScanner) Kind ¶
func (m *MockDistributionScanner) Kind() string
Kind mocks base method
func (*MockDistributionScanner) Name ¶
func (m *MockDistributionScanner) Name() string
Name mocks base method
func (*MockDistributionScanner) Scan ¶
func (m *MockDistributionScanner) Scan(arg0 context.Context, arg1 *claircore.Layer) ([]*claircore.Distribution, error)
Scan mocks base method
func (*MockDistributionScanner) Version ¶
func (m *MockDistributionScanner) Version() string
Version mocks base method
type MockDistributionScannerMockRecorder ¶
type MockDistributionScannerMockRecorder struct {
// contains filtered or unexported fields
}
MockDistributionScannerMockRecorder is the mock recorder for MockDistributionScanner
func (*MockDistributionScannerMockRecorder) Kind ¶
func (mr *MockDistributionScannerMockRecorder) Kind() *gomock.Call
Kind indicates an expected call of Kind
func (*MockDistributionScannerMockRecorder) Name ¶
func (mr *MockDistributionScannerMockRecorder) Name() *gomock.Call
Name indicates an expected call of Name
func (*MockDistributionScannerMockRecorder) Scan ¶
func (mr *MockDistributionScannerMockRecorder) Scan(arg0, arg1 interface{}) *gomock.Call
Scan indicates an expected call of Scan
func (*MockDistributionScannerMockRecorder) Version ¶
func (mr *MockDistributionScannerMockRecorder) Version() *gomock.Call
Version indicates an expected call of Version
type MockFetcher ¶
type MockFetcher struct {
// contains filtered or unexported fields
}
MockFetcher is a mock of Fetcher interface
func NewMockFetcher ¶
func NewMockFetcher(ctrl *gomock.Controller) *MockFetcher
NewMockFetcher creates a new mock instance
func (*MockFetcher) EXPECT ¶
func (m *MockFetcher) EXPECT() *MockFetcherMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockFetcherMockRecorder ¶
type MockFetcherMockRecorder struct {
// contains filtered or unexported fields
}
MockFetcherMockRecorder is the mock recorder for MockFetcher
func (*MockFetcherMockRecorder) Fetch ¶
func (mr *MockFetcherMockRecorder) Fetch(arg0, arg1 interface{}) *gomock.Call
Fetch indicates an expected call of Fetch
func (*MockFetcherMockRecorder) Purge ¶
func (mr *MockFetcherMockRecorder) Purge() *gomock.Call
Purge indicates an expected call of Purge
type MockLayerScanner ¶
type MockLayerScanner struct {
// contains filtered or unexported fields
}
MockLayerScanner is a mock of LayerScanner interface
func NewMockLayerScanner ¶
func NewMockLayerScanner(ctrl *gomock.Controller) *MockLayerScanner
NewMockLayerScanner creates a new mock instance
func (*MockLayerScanner) EXPECT ¶
func (m *MockLayerScanner) EXPECT() *MockLayerScannerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockLayerScannerMockRecorder ¶
type MockLayerScannerMockRecorder struct {
// contains filtered or unexported fields
}
MockLayerScannerMockRecorder is the mock recorder for MockLayerScanner
func (*MockLayerScannerMockRecorder) Scan ¶
func (mr *MockLayerScannerMockRecorder) Scan(arg0, arg1, arg2 interface{}) *gomock.Call
Scan indicates an expected call of Scan
type MockPackageScanner ¶
type MockPackageScanner struct {
// contains filtered or unexported fields
}
MockPackageScanner is a mock of PackageScanner interface
func NewMockPackageScanner ¶
func NewMockPackageScanner(ctrl *gomock.Controller) *MockPackageScanner
NewMockPackageScanner creates a new mock instance
func (*MockPackageScanner) EXPECT ¶
func (m *MockPackageScanner) EXPECT() *MockPackageScannerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockPackageScanner) Scan ¶
func (m *MockPackageScanner) Scan(arg0 context.Context, arg1 *claircore.Layer) ([]*claircore.Package, error)
Scan mocks base method
func (*MockPackageScanner) Version ¶
func (m *MockPackageScanner) Version() string
Version mocks base method
type MockPackageScannerMockRecorder ¶
type MockPackageScannerMockRecorder struct {
// contains filtered or unexported fields
}
MockPackageScannerMockRecorder is the mock recorder for MockPackageScanner
func (*MockPackageScannerMockRecorder) Kind ¶
func (mr *MockPackageScannerMockRecorder) Kind() *gomock.Call
Kind indicates an expected call of Kind
func (*MockPackageScannerMockRecorder) Name ¶
func (mr *MockPackageScannerMockRecorder) Name() *gomock.Call
Name indicates an expected call of Name
func (*MockPackageScannerMockRecorder) Scan ¶
func (mr *MockPackageScannerMockRecorder) Scan(arg0, arg1 interface{}) *gomock.Call
Scan indicates an expected call of Scan
func (*MockPackageScannerMockRecorder) Version ¶
func (mr *MockPackageScannerMockRecorder) Version() *gomock.Call
Version indicates an expected call of Version
type MockRepositoryScanner ¶
type MockRepositoryScanner struct {
// contains filtered or unexported fields
}
MockRepositoryScanner is a mock of RepositoryScanner interface
func NewMockRepositoryScanner ¶
func NewMockRepositoryScanner(ctrl *gomock.Controller) *MockRepositoryScanner
NewMockRepositoryScanner creates a new mock instance
func (*MockRepositoryScanner) EXPECT ¶
func (m *MockRepositoryScanner) EXPECT() *MockRepositoryScannerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockRepositoryScanner) Kind ¶
func (m *MockRepositoryScanner) Kind() string
Kind mocks base method
func (*MockRepositoryScanner) Name ¶
func (m *MockRepositoryScanner) Name() string
Name mocks base method
func (*MockRepositoryScanner) Scan ¶
func (m *MockRepositoryScanner) Scan(arg0 context.Context, arg1 *claircore.Layer) ([]*claircore.Repository, error)
Scan mocks base method
func (*MockRepositoryScanner) Version ¶
func (m *MockRepositoryScanner) Version() string
Version mocks base method
type MockRepositoryScannerMockRecorder ¶
type MockRepositoryScannerMockRecorder struct {
// contains filtered or unexported fields
}
MockRepositoryScannerMockRecorder is the mock recorder for MockRepositoryScanner
func (*MockRepositoryScannerMockRecorder) Kind ¶
func (mr *MockRepositoryScannerMockRecorder) Kind() *gomock.Call
Kind indicates an expected call of Kind
func (*MockRepositoryScannerMockRecorder) Name ¶
func (mr *MockRepositoryScannerMockRecorder) Name() *gomock.Call
Name indicates an expected call of Name
func (*MockRepositoryScannerMockRecorder) Scan ¶
func (mr *MockRepositoryScannerMockRecorder) Scan(arg0, arg1 interface{}) *gomock.Call
Scan indicates an expected call of Scan
func (*MockRepositoryScannerMockRecorder) Version ¶
func (mr *MockRepositoryScannerMockRecorder) Version() *gomock.Call
Version indicates an expected call of Version
type MockStore ¶
type MockStore struct {
// contains filtered or unexported fields
}
MockStore is a mock of Store interface
func NewMockStore ¶
func NewMockStore(ctrl *gomock.Controller) *MockStore
NewMockStore creates a new mock instance
func (*MockStore) DistributionsByLayer ¶
func (m *MockStore) DistributionsByLayer(arg0 context.Context, arg1 string, arg2 VersionedScanners) ([]*claircore.Distribution, error)
DistributionsByLayer mocks base method
func (*MockStore) EXPECT ¶
func (m *MockStore) EXPECT() *MockStoreMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockStore) IndexDistributions ¶
func (m *MockStore) IndexDistributions(arg0 context.Context, arg1 []*claircore.Distribution, arg2 *claircore.Layer, arg3 VersionedScanner) error
IndexDistributions mocks base method
func (*MockStore) IndexPackages ¶
func (m *MockStore) IndexPackages(arg0 context.Context, arg1 []*claircore.Package, arg2 *claircore.Layer, arg3 VersionedScanner) error
IndexPackages mocks base method
func (*MockStore) IndexReport ¶
func (m *MockStore) IndexReport(arg0 context.Context, arg1 string) (*claircore.IndexReport, bool, error)
IndexReport mocks base method
func (*MockStore) IndexRepositories ¶
func (m *MockStore) IndexRepositories(arg0 context.Context, arg1 []*claircore.Repository, arg2 *claircore.Layer, arg3 VersionedScanner) error
IndexRepositories mocks base method
func (*MockStore) LayerScanned ¶
func (m *MockStore) LayerScanned(arg0 context.Context, arg1 string, arg2 VersionedScanner) (bool, error)
LayerScanned mocks base method
func (*MockStore) ManifestScanned ¶
func (m *MockStore) ManifestScanned(arg0 context.Context, arg1 string, arg2 VersionedScanners) (bool, error)
ManifestScanned mocks base method
func (*MockStore) PackagesByLayer ¶
func (m *MockStore) PackagesByLayer(arg0 context.Context, arg1 string, arg2 VersionedScanners) ([]*claircore.Package, error)
PackagesByLayer mocks base method
func (*MockStore) RegisterScanners ¶
func (m *MockStore) RegisterScanners(arg0 context.Context, arg1 VersionedScanners) error
RegisterScanners mocks base method
func (*MockStore) RepositoriesByLayer ¶
func (m *MockStore) RepositoriesByLayer(arg0 context.Context, arg1 string, arg2 VersionedScanners) ([]*claircore.Repository, error)
RepositoriesByLayer mocks base method
func (*MockStore) SetIndexFinished ¶
func (m *MockStore) SetIndexFinished(arg0 context.Context, arg1 *claircore.IndexReport, arg2 VersionedScanners) error
SetIndexFinished mocks base method
func (*MockStore) SetIndexReport ¶
SetIndexReport mocks base method
type MockStoreMockRecorder ¶
type MockStoreMockRecorder struct {
// contains filtered or unexported fields
}
MockStoreMockRecorder is the mock recorder for MockStore
func (*MockStoreMockRecorder) DistributionsByLayer ¶
func (mr *MockStoreMockRecorder) DistributionsByLayer(arg0, arg1, arg2 interface{}) *gomock.Call
DistributionsByLayer indicates an expected call of DistributionsByLayer
func (*MockStoreMockRecorder) IndexDistributions ¶
func (mr *MockStoreMockRecorder) IndexDistributions(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
IndexDistributions indicates an expected call of IndexDistributions
func (*MockStoreMockRecorder) IndexPackages ¶
func (mr *MockStoreMockRecorder) IndexPackages(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
IndexPackages indicates an expected call of IndexPackages
func (*MockStoreMockRecorder) IndexReport ¶
func (mr *MockStoreMockRecorder) IndexReport(arg0, arg1 interface{}) *gomock.Call
IndexReport indicates an expected call of IndexReport
func (*MockStoreMockRecorder) IndexRepositories ¶
func (mr *MockStoreMockRecorder) IndexRepositories(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
IndexRepositories indicates an expected call of IndexRepositories
func (*MockStoreMockRecorder) LayerScanned ¶
func (mr *MockStoreMockRecorder) LayerScanned(arg0, arg1, arg2 interface{}) *gomock.Call
LayerScanned indicates an expected call of LayerScanned
func (*MockStoreMockRecorder) ManifestScanned ¶
func (mr *MockStoreMockRecorder) ManifestScanned(arg0, arg1, arg2 interface{}) *gomock.Call
ManifestScanned indicates an expected call of ManifestScanned
func (*MockStoreMockRecorder) PackagesByLayer ¶
func (mr *MockStoreMockRecorder) PackagesByLayer(arg0, arg1, arg2 interface{}) *gomock.Call
PackagesByLayer indicates an expected call of PackagesByLayer
func (*MockStoreMockRecorder) RegisterScanners ¶
func (mr *MockStoreMockRecorder) RegisterScanners(arg0, arg1 interface{}) *gomock.Call
RegisterScanners indicates an expected call of RegisterScanners
func (*MockStoreMockRecorder) RepositoriesByLayer ¶
func (mr *MockStoreMockRecorder) RepositoriesByLayer(arg0, arg1, arg2 interface{}) *gomock.Call
RepositoriesByLayer indicates an expected call of RepositoriesByLayer
func (*MockStoreMockRecorder) SetIndexFinished ¶
func (mr *MockStoreMockRecorder) SetIndexFinished(arg0, arg1, arg2 interface{}) *gomock.Call
SetIndexFinished indicates an expected call of SetIndexFinished
func (*MockStoreMockRecorder) SetIndexReport ¶
func (mr *MockStoreMockRecorder) SetIndexReport(arg0, arg1 interface{}) *gomock.Call
SetIndexReport indicates an expected call of SetIndexReport
type MockVersionedScanner ¶
type MockVersionedScanner struct {
// contains filtered or unexported fields
}
MockVersionedScanner is a mock of VersionedScanner interface
func NewMockVersionedScanner ¶
func NewMockVersionedScanner(ctrl *gomock.Controller) *MockVersionedScanner
NewMockVersionedScanner creates a new mock instance
func (*MockVersionedScanner) EXPECT ¶
func (m *MockVersionedScanner) EXPECT() *MockVersionedScannerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockVersionedScanner) Kind ¶
func (m *MockVersionedScanner) Kind() string
Kind mocks base method
func (*MockVersionedScanner) Name ¶
func (m *MockVersionedScanner) Name() string
Name mocks base method
func (*MockVersionedScanner) Version ¶
func (m *MockVersionedScanner) Version() string
Version mocks base method
type MockVersionedScannerMockRecorder ¶
type MockVersionedScannerMockRecorder struct {
// contains filtered or unexported fields
}
MockVersionedScannerMockRecorder is the mock recorder for MockVersionedScanner
func (*MockVersionedScannerMockRecorder) Kind ¶
func (mr *MockVersionedScannerMockRecorder) Kind() *gomock.Call
Kind indicates an expected call of Kind
func (*MockVersionedScannerMockRecorder) Name ¶
func (mr *MockVersionedScannerMockRecorder) Name() *gomock.Call
Name indicates an expected call of Name
func (*MockVersionedScannerMockRecorder) Version ¶
func (mr *MockVersionedScannerMockRecorder) Version() *gomock.Call
Version indicates an expected call of Version
type Opts ¶
type Opts struct { Store Store ScanLock distlock.Locker LayerScanner LayerScanner Fetcher Fetcher Ecosystems []*Ecosystem Vscnrs VersionedScanners }
Opts are options to instantiate a indexer
type PackageScanner ¶
type PackageScanner interface { VersionedScanner // Scan performs a package scan on the given layer and returns all // the found packages Scan(context.Context, *claircore.Layer) ([]*claircore.Package, error) }
PackageScanner provides an interface for unique identification or a PackageScanner and a Scan method for extracting installed packages from an individual container layer
func NewPackageScannerMock ¶
func NewPackageScannerMock(name, version, kind string) PackageScanner
type RepositoryScanner ¶
type RepositoryScanner interface { VersionedScanner Scan(context.Context, *claircore.Layer) ([]*claircore.Repository, error) }
type Store ¶
type Store interface { // ManifestScanned returns whether the given manifest was scanned by the provided scanners ManifestScanned(ctx context.Context, hash string, scnrs VersionedScanners) (bool, error) // LayerScanned returns whether the given layer was scanned by the provided scanner. LayerScanned(ctx context.Context, hash string, scnr VersionedScanner) (bool, error) // IndexPackages indexes a package into the persistence layer. IndexPackages(ctx context.Context, pkgs []*claircore.Package, layer *claircore.Layer, scnr VersionedScanner) error // IndexDistributions indexes distributions into the persistence layer IndexDistributions(ctx context.Context, dists []*claircore.Distribution, layer *claircore.Layer, scnr VersionedScanner) error // IndexRepositories indexes repositories into the persistence layer IndexRepositories(ctx context.Context, repos []*claircore.Repository, layer *claircore.Layer, scnr VersionedScanner) error // PackagesByLayer gets all the packages found in a layer limited by the provided scanners PackagesByLayer(ctx context.Context, hash string, scnrs VersionedScanners) ([]*claircore.Package, error) // DistributionsByLayer gets all the distributions found in a layer limited by the provided scanners DistributionsByLayer(ctx context.Context, hash string, scnrs VersionedScanners) ([]*claircore.Distribution, error) // RepositoriesByLayer gets all the repositories found in a layer limited by the provided scanners RepositoriesByLayer(ctx context.Context, hash string, scnrs VersionedScanners) ([]*claircore.Repository, error) // RegisterPackageScanners registers the provided scanners with the persistence layer RegisterScanners(ctx context.Context, scnrs VersionedScanners) error // IndexReport attempts to retrieve a persisted IndexReport. IndexReport(ctx context.Context, hash string) (*claircore.IndexReport, bool, error) // SetIndexReport persists the current state of the IndexReport. IndexReports may // be in intermediate states to provide feedback for clients. this method should be // used to communicate scanning state updates. to signal the scan has completely successfully // see SetScanFinished SetIndexReport(context.Context, *claircore.IndexReport) error // SetScanFinished marks a scan successfully completed. an association between // the provided manifest hash within the IndexReport and the list of VersionedScanners // should be made in such a way that ManifestScanned() correctly identifies if the manifest // was previously scanned by the given scnrs. the ScanResult should be pushed to the persistence // store. SetIndexFinished(ctx context.Context, sr *claircore.IndexReport, scnrs VersionedScanners) error }
Store is an interface for dealing with objects libindex needs to persist. Stores may be implemented per storage backend.
type VersionedScanner ¶
type VersionedScanner interface { // unique name of the distribution scanner. Name() string // version of this scanner. this information will be persisted with the scan. Version() string // the kind of scanner. currently only package is implemented Kind() string }
VersionedScanner can be imbeded into specific scanner types. This allows for methods and functions which only need to compare names and versions of scanners not to require each scanner type as an argument
type VersionedScanners ¶
type VersionedScanners []VersionedScanner
VersionedScanners implements a list with construction methods not concurrency safe
func MergeVS ¶
func MergeVS(pscnr []PackageScanner, dscnr []DistributionScanner, rscnr []RepositoryScanner) VersionedScanners
MergeVS merges lists of scanners into a single list of VersionedScanner types
func (*VersionedScanners) DStoVS ¶
func (vs *VersionedScanners) DStoVS(scnrs []DistributionScanner)
DStoVS takes an array of DistributionScanners and appends VersionedScanners with VersionScanner types.
func (*VersionedScanners) PStoVS ¶
func (vs *VersionedScanners) PStoVS(scnrs []PackageScanner)
PStoVS takes an array of PackageScanners and appends VersionedScanners with VersionScanner types.
func (*VersionedScanners) RStoVS ¶
func (vs *VersionedScanners) RStoVS(scnrs []RepositoryScanner)
RStoVS takes an array of RepositoryScanners and appends VersionedScanners with VersionScanner types.
func (VersionedScanners) VStoDS ¶
func (vs VersionedScanners) VStoDS() []DistributionScanner
VStoDS returns an array of DistributionScanners
func (VersionedScanners) VStoPS ¶
func (vs VersionedScanners) VStoPS() []PackageScanner
VStoPS returns an array of PackageScanners
func (VersionedScanners) VStoRS ¶
func (vs VersionedScanners) VStoRS() []RepositoryScanner
VStoRS returns an array of RepositoryScanners
Source Files ¶
- coalescer.go
- coalescer_mock.go
- distributionscanner.go
- distributionscanner_mock.go
- ecosystem.go
- fetcher.go
- fetcher_mock.go
- layerscanner.go
- layerscanner_mock.go
- mock_generate.go
- opts.go
- packagescanner.go
- packagescanner_mock.go
- reposcanner_mock.go
- repositoryscanner.go
- store.go
- store_mock.go
- versionedscanner.go
- versionedscanner_mock.go