github.com/quay/claircore@v1.5.28/docs/howto_test.go (about)

     1  package docs
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/quay/claircore/indexer"
     7  )
     8  
     9  // ANCHOR: example
    10  // HaskellScanner returns a configured PackageScanner.
    11  func haskellScanner() indexer.PackageScanner { return nil }
    12  
    13  // HaskellCoalescer returns a configured Coalescer.
    14  func haskellCoalescer() indexer.Coalescer { return nil }
    15  
    16  // NewEcosystem provides the set of scanners and coalescers for the haskell
    17  // ecosystem.
    18  func NewEcosystem(ctx context.Context) *indexer.Ecosystem {
    19  	return &indexer.Ecosystem{
    20  		PackageScanners: func(ctx context.Context) ([]indexer.PackageScanner, error) {
    21  			return []indexer.PackageScanner{haskellScanner()}, nil
    22  		},
    23  		DistributionScanners: func(ctx context.Context) ([]indexer.DistributionScanner, error) {
    24  			return []indexer.DistributionScanner{}, nil
    25  		},
    26  		RepositoryScanners: func(ctx context.Context) ([]indexer.RepositoryScanner, error) {
    27  			return []indexer.RepositoryScanner{}, nil
    28  		},
    29  		Coalescer: func(ctx context.Context) (indexer.Coalescer, error) {
    30  			return haskellCoalescer(), nil
    31  		},
    32  	}
    33  }
    34  
    35  // ANCHOR_END: example