github.com/noqcks/syft@v0.0.0-20230920222752-a9e2c4e288e5/syft/pkg/cataloger/config.go (about)

     1  package cataloger
     2  
     3  import (
     4  	"github.com/anchore/syft/syft/pkg/cataloger/golang"
     5  	"github.com/anchore/syft/syft/pkg/cataloger/java"
     6  	"github.com/anchore/syft/syft/pkg/cataloger/kernel"
     7  	"github.com/anchore/syft/syft/pkg/cataloger/python"
     8  )
     9  
    10  // TODO: these field naming vs helper function naming schemes are inconsistent.
    11  type Config struct {
    12  	Search                          SearchConfig
    13  	Golang                          golang.GoCatalogerOpts
    14  	LinuxKernel                     kernel.LinuxCatalogerConfig
    15  	Python                          python.CatalogerConfig
    16  	Catalogers                      []string
    17  	Parallelism                     int
    18  	ExcludeBinaryOverlapByOwnership bool
    19  }
    20  
    21  func DefaultConfig() Config {
    22  	return Config{
    23  		Search:                          DefaultSearchConfig(),
    24  		Parallelism:                     1,
    25  		LinuxKernel:                     kernel.DefaultLinuxCatalogerConfig(),
    26  		Python:                          python.DefaultCatalogerConfig(),
    27  		ExcludeBinaryOverlapByOwnership: true,
    28  	}
    29  }
    30  
    31  func (c Config) Java() java.Config {
    32  	return java.Config{
    33  		SearchUnindexedArchives: c.Search.IncludeUnindexedArchives,
    34  		SearchIndexedArchives:   c.Search.IncludeIndexedArchives,
    35  	}
    36  }