mirror of
https://github.com/anchore/syft
synced 2024-11-10 14:24:12 +00:00
4f0099583a
Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>
24 lines
898 B
Go
24 lines
898 B
Go
package config
|
|
|
|
import (
|
|
"github.com/anchore/syft/internal/file"
|
|
"github.com/anchore/syft/syft/source"
|
|
"github.com/spf13/viper"
|
|
)
|
|
|
|
type fileContents struct {
|
|
Cataloger catalogerOptions `yaml:"cataloger" json:"cataloger" mapstructure:"cataloger"`
|
|
SkipFilesAboveSize int64 `yaml:"skip-files-above-size" json:"skip-files-above-size" mapstructure:"skip-files-above-size"`
|
|
Globs []string `yaml:"globs" json:"globs" mapstructure:"globs"`
|
|
}
|
|
|
|
func (cfg fileContents) loadDefaultValues(v *viper.Viper) {
|
|
v.SetDefault("file-contents.cataloger.enabled", catalogerEnabledDefault)
|
|
v.SetDefault("file-contents.cataloger.scope", source.SquashedScope)
|
|
v.SetDefault("file-contents.skip-files-above-size", 1*file.MB)
|
|
v.SetDefault("file-contents.globs", []string{})
|
|
}
|
|
|
|
func (cfg *fileContents) parseConfigValues() error {
|
|
return cfg.Cataloger.parseConfigValues()
|
|
}
|