config

package
v0.1.0-beta.11 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2020 License: Apache-2.0 Imports: 12 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
	PresenterOpt      presenter.Option
	Output            string `mapstructure:"output"`
	ScopeOpt          scope.Option
	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
}

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"`
}

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
	Level        string `mapstructure:"level"`
	FileLocation string `mapstructure:"file"`
}

Jump to

Keyboard shortcuts

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