cmd

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package cmd contains the ClI execution logic using cobra

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrorFileAccess permissions, missing an expected file, etc.
	ErrorFileAccess = errors.New("File Access Failure")
	// ErrorEncoding anything dealing with encoding / decoding
	ErrorEncoding = errors.New("Encoding Failure")
	// ErrorValidation violations of validtion rules
	ErrorValidation = errors.New("Validation Failure")
	// ErrorAPI unexpected responses from APIs
	ErrorAPI = errors.New("API Failure")
	// ErrorUserInput unexpected or non-processable user input
	ErrorUserInput = errors.New("User Input Failure")
)

Functions

func NewRootCommand

func NewRootCommand(config CLIConfig) *cobra.Command

NewRootCommand configures the sub commands.

Types

type AsyncDecoder

type AsyncDecoder interface {
	io.Writer
	Decode() (any, error)
	DecodeFrom(r io.Reader) (any, error)
	FileType() string
	Reset()
}

AsyncDecoder decodes into a specific report type given content.

The Async Decoder should read content and decode it into any number of object types or return an encoding error

type CLIConfig

type CLIConfig struct {
	Version             string
	PipedInput          *os.File
	EPSSDownloadAgent   io.Reader
	KEVDownloadAgent    io.Reader
	DDExportService     ddExportService
	DDEngagement        defectdojo.EngagementQuery
	DDExportTimeout     time.Duration
	AWSExportService    awsExportService
	AWSExportTimeout    time.Duration
	NewAsyncDecoderFunc func() AsyncDecoder
	ConfigMap           map[string]any
	ConfigFileUsed      string
	ConfigPath          string
}

CLIConfig used by all of the cmds

Jump to

Keyboard shortcuts

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