Documentation
¶
Overview ¶
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. * * This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. * * This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.
Index ¶
- func FileAnalyzer(path string) (string, error)
- func GenerateReport(ctx context.Context, path, filename string, body interface{}, formats []string, ...) error
- func GetDefaultQueryPath(queriesPath string) (string, error)
- func GetExecutableDirectory() string
- func GetFullPath(partialPath string) (string, error)
- func GetNumCPU() float32
- func ResultsExitCodeWithConfig(config *ExitHandler, summary *model.Summary) int
- type ExitHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileAnalyzer ¶
FileAnalyzer determines the type of extension in the passed config file by its content
func GenerateReport ¶
func GenerateReport(ctx context.Context, path, filename string, body interface{}, formats []string, sciInfo *model.SCIInfo) error
GenerateReport execute each report function to generate report
func GetDefaultQueryPath ¶
GetDefaultQueryPath - returns the default query path
func GetExecutableDirectory ¶
func GetExecutableDirectory() string
GetExecutableDirectory - returns the path to the directory containing KICS executable
func GetFullPath ¶
GetFulPath returns the full path of a partial path used for queries or experimental queries json path Note: This function does not validate if the path exists on the filesystem because queries are embedded in the binary and loaded via assets.GetEmbeddedQueryDirs(). The returned path is only used for logging/display purposes.
func ResultsExitCodeWithConfig ¶
func ResultsExitCodeWithConfig(config *ExitHandler, summary *model.Summary) int
Types ¶
type ExitHandler ¶
func NewExitHandler ¶
func NewExitHandler() *ExitHandler
func ResultsExitCode ¶
func ResultsExitCode(summary *model.Summary) (*ExitHandler, int)
ResultsExitCode calculate exit code base on severity of results, returns 0 if no results was reported nolint:gocritic
func (*ExitHandler) ShowError ¶
func (config *ExitHandler) ShowError(kind string) bool
ShowError returns true if should show error, otherwise returns false