Documentation ¶
Index ¶
- Constants
- Variables
- func CaptureCommandOutput(cmd *cobra.Command, args []string) (string, error)
- func CaptureOutput(funcToExec execute) (string, error)
- func ChangeCurrentDir(desiredDir string) error
- func GetCurrentDirName(path string) string
- func MapToStringSlice(stringKeyMap map[string]string) []string
- func StringifyStruct(v interface{}) (string, error)
Constants ¶
const ValidUUIDRegex = `(?i)^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$`
ValidUUIDRegex is a constant representing a regular expression rule to validate UUID string
Variables ¶
var ComplexSummaryMock = model.Summary{ Counters: model.Counters{ ScannedFiles: 2, ParsedFiles: 2, FailedToScanFiles: 0, TotalQueries: 2, FailedToExecuteQueries: 0, }, Queries: []model.VulnerableQuery{ queryHigh, queryMedium, }, SeveritySummary: model.SeveritySummary{ ScanID: "console", SeverityCounters: map[model.Severity]int{ model.SeverityInfo: 0, model.SeverityLow: 0, model.SeverityMedium: 1, model.SeverityHigh: 2, }, TotalCounter: 3, }, }
ComplexSummaryMock a summary with more results to be used without running kics scan
var SummaryMock = model.Summary{ Counters: model.Counters{ ScannedFiles: 1, ParsedFiles: 1, FailedToScanFiles: 0, TotalQueries: 1, FailedToExecuteQueries: 0, }, Queries: []model.VulnerableQuery{ queryHigh, }, SeveritySummary: model.SeveritySummary{ ScanID: "console", SeverityCounters: map[model.Severity]int{ model.SeverityInfo: 0, model.SeverityLow: 0, model.SeverityMedium: 0, model.SeverityHigh: 2, }, TotalCounter: 2, }, }
SummaryMock a summary to be used without running kics scan
Functions ¶
func CaptureCommandOutput ¶
CaptureCommandOutput set cobra command args, if necessary, then capture the output
func CaptureOutput ¶
CaptureOutput changes default stdout to intercept into a buffer, converts it to string and returns it
func ChangeCurrentDir ¶
ChangeCurrentDir gets current working directory and changes to its parent until finds the desired directory or fail
func GetCurrentDirName ¶
GetCurrentDirName returns current working directory
func MapToStringSlice ¶ added in v1.2.0
MapToStringSlice extract slice of keys from a map[string]string
func StringifyStruct ¶ added in v1.1.3
StringifyStruct stringify struct for pretty print
Types ¶
This section is empty.