option

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactOption

type ArtifactOption struct {
	Input      string
	Timeout    time.Duration
	ClearCache bool

	SkipDirs  []string
	SkipFiles []string

	// this field is populated in Init()
	Target string
}

ArtifactOption holds the options for an artifact scanning

func NewArtifactOption

func NewArtifactOption(c *cli.Context) ArtifactOption

NewArtifactOption is the factory method to return artifact option

func (*ArtifactOption) Init

func (c *ArtifactOption) Init(ctx *cli.Context, logger *zap.SugaredLogger) (err error)

Init initialize the CLI context for artifact scanning

type CacheOption

type CacheOption struct {
	CacheBackend string
}

CacheOption holds the options for cache

func NewCacheOption

func NewCacheOption(c *cli.Context) CacheOption

NewCacheOption returns an instance of CacheOption

func (*CacheOption) Init

func (c *CacheOption) Init() error

Init initialize the CacheOption

type ConfigOption added in v0.19.0

type ConfigOption struct {
	FilePatterns       []string
	IncludeNonFailures bool
	SkipPolicyUpdate   bool
	Trace              bool

	// Rego
	PolicyPaths      []string
	DataPaths        []string
	PolicyNamespaces []string
}

ConfigOption holds the options for config scanning

func NewConfigOption added in v0.19.0

func NewConfigOption(c *cli.Context) ConfigOption

NewConfigOption is the factory method to return config scanning options

type DBOption

type DBOption struct {
	Reset          bool
	DownloadDBOnly bool
	SkipDBUpdate   bool
	Light          bool
	NoProgress     bool
}

DBOption holds the options for trivy DB

func NewDBOption

func NewDBOption(c *cli.Context) DBOption

NewDBOption is the factory method to return the DBOption

func (*DBOption) Init

func (c *DBOption) Init() (err error)

Init initialize the DBOption

type GlobalOption

type GlobalOption struct {
	Context *cli.Context
	Logger  *zap.SugaredLogger

	AppVersion string
	Quiet      bool
	Debug      bool
	CacheDir   string
}

GlobalOption holds the global options for trivy

func NewGlobalOption

func NewGlobalOption(c *cli.Context) (GlobalOption, error)

NewGlobalOption is the factory method to return GlobalOption

type ImageOption

type ImageOption struct {
	ScanRemovedPkgs bool
	ListAllPkgs     bool
}

ImageOption holds the options for scanning images

func NewImageOption

func NewImageOption(c *cli.Context) ImageOption

NewImageOption is the factory method to return ImageOption

type ReportOption

type ReportOption struct {
	Format   string
	Template string

	IgnoreFile    string
	IgnoreUnfixed bool
	ExitCode      int
	IgnorePolicy  string

	// these variables are populated by Init()
	VulnType       []string
	SecurityChecks []string
	Output         *os.File
	Severities     []dbTypes.Severity
	// contains filtered or unexported fields
}

ReportOption holds the options for reporting scan results

func NewReportOption

func NewReportOption(c *cli.Context) ReportOption

NewReportOption is the factory method to return ReportOption

func (*ReportOption) Init

func (c *ReportOption) Init(logger *zap.SugaredLogger) error

Init initializes the ReportOption

Jump to

Keyboard shortcuts

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