config

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	ConfigPath         string
	Output             string       `mapstructure:"output"`
	OutputTemplateFile string       `mapstructure:"output-template-file"`
	ScopeOpt           source.Scope `json:"-"`
	Scope              string       `mapstructure:"scope"`
	Quiet              bool         `mapstructure:"quiet"`
	Log                Logging      `mapstructure:"log"`
	CliOptions         CliOnlyOptions
	Db                 Database                `mapstructure:"db"`
	Dev                Development             `mapstructure:"dev"`
	CheckForAppUpdate  bool                    `mapstructure:"check-for-app-update"`
	FailOn             string                  `mapstructure:"fail-on-severity"`
	FailOnSeverity     *vulnerability.Severity `json:"-"`
	Registry           registry                `yaml:"registry" json:"registry" mapstructure:"registry"`
}

func LoadConfigFromFile

func LoadConfigFromFile(v *viper.Viper, cliOpts *CliOnlyOptions) (*Application, error)

func (*Application) Build

func (cfg *Application) Build() error

type CliOnlyOptions

type CliOnlyOptions struct {
	ConfigPath string
	Verbosity  int
}

type Database

type Database struct {
	Dir                   string `mapstructure:"cache-dir"`
	UpdateURL             string `mapstructure:"update-url"`
	AutoUpdate            bool   `mapstructure:"auto-update"`
	ValidateByHashOnStart bool   `mapstructure:"validate-by-hash-on-start"`
}

func (Database) ToCuratorConfig

func (d Database) ToCuratorConfig() db.Config

type Development

type Development struct {
	ProfileCPU bool `mapstructure:"profile-cpu"`
}

type Logging

type Logging struct {
	Structured   bool         `mapstructure:"structured"`
	LevelOpt     logrus.Level `json:"-"`
	Level        string       `mapstructure:"level"`
	FileLocation string       `mapstructure:"file"`
}

type RegistryCredentials

type RegistryCredentials struct {
	Authority string `yaml:"authority" json:"authority" mapstructure:"authority"`
	// IMPORTANT: do not show the username in any YAML/JSON output (sensitive information)
	Username string `yaml:"-" json:"-" mapstructure:"username"`
	// IMPORTANT: do not show the password in any YAML/JSON output (sensitive information)
	Password string `yaml:"-" json:"-" mapstructure:"password"`
	// IMPORTANT: do not show the token in any YAML/JSON output (sensitive information)
	Token string `yaml:"-" json:"-" mapstructure:"token"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL