cli

package
v0.0.0-...-b2779c9 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BOMFileFormatFlag

type BOMFileFormatFlag struct {
	Format cyclonedx.BOMFileFormat
}

func (*BOMFileFormatFlag) Decode

func (b *BOMFileFormatFlag) Decode(ctx *kong.DecodeContext) error

Decode implements kong.MapperValue.

type DBFlag

type DBFlag struct {
	Path string        `name:"path" help:"Path to the database data directory" default:"${XDG_CACHE_HOME}/aucs/db"`
	TTL  time.Duration `name:"ttl" help:"Time to live for dependency look entries" default:"6h"`
}

func (DBFlag) Open

func (f DBFlag) Open() (ports.KeyValueStore, error)

type EnrichCLiHandler

type EnrichCLiHandler struct {
	SBOMFile *os.File `arg:"" help:"SBOM file to enrich"`

	BOMFormat       BOMFileFormatFlag `name:"bom-format" help:"BOM file format" default:"json"`
	DB              DBFlag            `embed:"" prefix:"db."`
	Parallelism     uint8             `name:"parallelism" help:"Number of parallel requests" default:"20"`
	WriteBackToFile bool              `name:"write" help:"If aucs should write the SBOM to the source file - if not will be written to STDOUT" default:"false"`

	HttpClient struct {
		Timeout               time.Duration `name:"timeout" help:"HTTP client timeout" default:"30s"`
		HystrixTimeout        time.Duration `name:"hystrix-timeout" help:"Hystrix timeout" default:"30s"`
		MaxConcurrentRequests int           `name:"max-concurrent-requests" help:"Maximum concurrent requests" default:"100"`
		Retry                 struct {
			InitialTimeout time.Duration `name:"initial-timeout" help:"Initial retry timeout" default:"1s"`
			MaxTimeout     time.Duration `name:"max-timeout" help:"Maximum retry timeout" default:"10s"`
			ExponentFactor float64       `name:"exponent-factor" help:"Exponential backoff factor" default:"2"`
			MaximumJitter  time.Duration `name:"maximum-jitter" help:"Maximum retry jitter" default:"200ms"`
		} `embed:"" prefix:"retry."`
	} `embed:"" prefix:"http-client."`

	KV       ports.KeyValueStore `kong:"-"`
	Checkers *checker.Registry   `kong:"-"`
}

func (*EnrichCLiHandler) AfterApply

func (h *EnrichCLiHandler) AfterApply() error

func (*EnrichCLiHandler) Run

func (h *EnrichCLiHandler) Run(ctx context.Context, stdout ports.STDOUT) (err error)

Jump to

Keyboard shortcuts

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