github.com/nextlinux/gosbom@v0.81.1-0.20230627115839-1ff50c281391/internal/config/file_metadata.go (about)

     1  package config
     2  
     3  import (
     4  	"github.com/nextlinux/gosbom/gosbom/source"
     5  	"github.com/spf13/viper"
     6  )
     7  
     8  type FileMetadata struct {
     9  	Cataloger catalogerOptions `yaml:"cataloger" json:"cataloger" mapstructure:"cataloger"`
    10  	Digests   []string         `yaml:"digests" json:"digests" mapstructure:"digests"`
    11  }
    12  
    13  func (cfg FileMetadata) loadDefaultValues(v *viper.Viper) {
    14  	v.SetDefault("file-metadata.cataloger.enabled", catalogerEnabledDefault)
    15  	v.SetDefault("file-metadata.cataloger.scope", source.SquashedScope)
    16  	v.SetDefault("file-metadata.digests", []string{"sha256"})
    17  }
    18  
    19  func (cfg *FileMetadata) parseConfigValues() error {
    20  	return cfg.Cataloger.parseConfigValues()
    21  }