Documentation ¶
Index ¶
- func CustomConsoleWriter(fileLogger *zerolog.ConsoleWriter) zerolog.ConsoleWriter
- func FileAnalyzer(path string) (string, error)
- func GenerateReport(path, filename string, body interface{}, formats []string) error
- func GetDefaultQueryPath(queriesPath string) (string, error)
- func GetExecutableDirectory() string
- func InitShouldFailArg(args []string) error
- func InitShouldIgnoreArg(arg string) error
- func ListReportFormats() []string
- func PrintResult(summary *model.Summary, failedQueries map[string]error, printer *Printer) error
- func ResultsExitCode(summary *model.Summary) int
- func ShowError(kind string) bool
- func ValidateReportFormats(formats []string) error
- func WordWrap(s, identation string, limit int) string
- type Printer
- type ProgressBar
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CustomConsoleWriter ¶
func CustomConsoleWriter(fileLogger *zerolog.ConsoleWriter) zerolog.ConsoleWriter
CustomConsoleWriter creates an output to print log in a files
func FileAnalyzer ¶ added in v1.1.4
FileAnalyzer determines the type of extension in the passed config file by its content
func GenerateReport ¶ added in v1.2.0
GenerateReport execute each report function to generate report
func GetDefaultQueryPath ¶ added in v1.2.4
GetDefaultQueryPath - returns the default query path
func GetExecutableDirectory ¶ added in v1.2.4
func GetExecutableDirectory() string
GetExecutableDirectory - returns the path to the directory containing KICS executable
func InitShouldFailArg ¶ added in v1.3.0
InitShouldFailArg initializes which kind of vulnerability severity should changes exit code
func InitShouldIgnoreArg ¶ added in v1.3.0
InitShouldIgnoreArg initializes what kind of errors should be used on exit codes
func ListReportFormats ¶ added in v1.3.0
func ListReportFormats() []string
ListReportFormats return a slice with all supported report formats
func PrintResult ¶
PrintResult prints on output the summary results
func ResultsExitCode ¶ added in v1.3.0
ResultsExitCode calculate exit code base on severity of results, returns 0 if no results was reported
func ShowError ¶ added in v1.3.0
ShowError returns true if should show error, otherwise returns false
func ValidateReportFormats ¶ added in v1.2.0
ValidateReportFormats returns an error if output format is not supported
Types ¶
type Printer ¶ added in v1.2.0
type Printer struct { Medium color.RGBColor High color.RGBColor Low color.RGBColor Info color.RGBColor Success color.RGBColor Line color.RGBColor // contains filtered or unexported fields }
Printer wil print console output with colors Medium is for medium sevevity results High is for high sevevity results Low is for low sevevity results Info is for info sevevity results Success is for successful prints Line is the color to print the line with the vulnerability minVersion is a bool that if true will print the results output in a minimum version
func NewPrinter ¶ added in v1.2.0
NewPrinter initializes a new Printer
func (*Printer) PrintBySev ¶ added in v1.2.0
PrintBySev will print the output with the specific severity color given the severity of the result
type ProgressBar ¶
ProgressBar represents a Progress Writer is the writer output for progress bar
func NewProgressBar ¶
func NewProgressBar(label string, space int, total float64, progress chan float64) ProgressBar
NewProgressBar initializes a new ProgressBar label is a string print before the progress bar total is the progress bar target (a.k.a 100%) space is the number of '=' characters on each side of the bar progress is a channel updating the current executed elements
func (*ProgressBar) Start ¶
func (p *ProgressBar) Start(wg *sync.WaitGroup)
Start starts to print a progress bar on console wg is a wait group to report when progress is done