-
Notifications
You must be signed in to change notification settings - Fork 84
/
ecosystem.go
31 lines (28 loc) · 985 Bytes
/
ecosystem.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package dpkg
import (
"context"
"github.com/quay/claircore/debian"
"github.com/quay/claircore/internal/indexer"
"github.com/quay/claircore/internal/indexer/linux"
"github.com/quay/claircore/ubuntu"
)
// NewEcosystem provides the set of scanners and coalescers for the dpkg ecosystem
func NewEcosystem(ctx context.Context) *indexer.Ecosystem {
return &indexer.Ecosystem{
PackageScanners: func(ctx context.Context) ([]indexer.PackageScanner, error) {
return []indexer.PackageScanner{&Scanner{}}, nil
},
DistributionScanners: func(ctx context.Context) ([]indexer.DistributionScanner, error) {
return []indexer.DistributionScanner{
&debian.DistributionScanner{},
&ubuntu.DistributionScanner{},
}, nil
},
RepositoryScanners: func(ctx context.Context) ([]indexer.RepositoryScanner, error) {
return []indexer.RepositoryScanner{}, nil
},
Coalescer: func(ctx context.Context) (indexer.Coalescer, error) {
return linux.NewCoalescer(), nil
},
}
}