helpers

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileAnalyzer

func FileAnalyzer(path string) (string, error)

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

func GetDefaultQueryPath(queriesPath string) (string, error)

GetDefaultQueryPath - returns the default query path

func GetExecutableDirectory

func GetExecutableDirectory() string

GetExecutableDirectory - returns the path to the directory containing KICS executable

func GetFullPath

func GetFullPath(partialPath string) (string, error)

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 GetNumCPU

func GetNumCPU() float32

GetNumCPU return the number of cpus available

func ResultsExitCodeWithConfig

func ResultsExitCodeWithConfig(config *ExitHandler, summary *model.Summary) int

Types

type ExitHandler

type ExitHandler struct {
	ShouldIgnore string
	ShouldFail   map[string]struct{}
}

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

Jump to

Keyboard shortcuts

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