cli

package
v1.19.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// LogLevel Logging level (debug, info, warn, error, panic, fatal)
	LogLevel string

	// LogType Logging output type (console, json)
	LogType string

	// OutputType Violation output type (human, json, yaml, xml, sarif)
	OutputType string

	// ConfigFile Config file path
	ConfigFile string

	// CustomTempDir Temporary directory path to download remote repository,module and templates
	CustomTempDir string

	// LogOutputDir Directory to write scan logs and result files
	LogOutputDir string
)

Functions

func Execute

func Execute()

Execute the entrypoint called by main

func NewFileWriter

func NewFileWriter(dir string, outputType string) (io.Writer, func() error)

NewFileWriter gets a new io.Writer based on file output and closing function. It returns `nil nil` if the value of dir is empty or if the file can't be opened

func NewOutputWriter

func NewOutputWriter(useColors bool) io.Writer

NewOutputWriter gets a new io.Writer based on os.Stdout. If param useColors=true, the writer will colorize the output

func RegisterCommand

func RegisterCommand(baseCommand *cobra.Command, command *cobra.Command)

RegisterCommand Registers a new command under the base command

Types

type ScanOptions

type ScanOptions struct {

	// UseColors indicates whether to use color output
	UseColors bool
	// contains filtered or unexported fields
}

ScanOptions represents scan command and its optional flags

func NewScanOptions

func NewScanOptions() *ScanOptions

NewScanOptions returns a new pointer to ScanOptions

func (*ScanOptions) Init

func (s *ScanOptions) Init() error

Init initialises and validates ScanOptions

func (*ScanOptions) Run

func (s *ScanOptions) Run() error

Run executes terrascan in CLI mode

func (*ScanOptions) Scan

func (s *ScanOptions) Scan() error

Scan executes the terrascan scan command

Jump to

Keyboard shortcuts

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