Documentation ¶
Index ¶
- Variables
- func CheckIfFailBuild(results []services.ScanResponse) bool
- func DownloadIndexerIfNeeded(xrayManager *xray.XrayServicesManager, xrayVersionStr string) (indexerPath string, err error)
- func NewFailBuildError() error
- func PrepareLicenses(licenses []services.License, multipleRoots bool) ([]formats.LicenseRow, error)
- func PrepareViolations(violations []services.Violation, multipleRoots bool) ([]formats.VulnerabilityOrViolationRow, []formats.LicenseViolationRow, ...)
- func PrepareVulnerabilities(vulnerabilities []services.Vulnerability, multipleRoots bool) ([]formats.VulnerabilityOrViolationRow, error)
- func PrintLicensesTable(licenses []services.License, multipleRoots, printExtended bool) error
- func PrintScanResults(results []services.ScanResponse, errors []formats.SimpleJsonError, ...) error
- func PrintViolationsTable(violations []services.Violation, multipleRoots, printExtended bool) error
- func PrintVulnerabilitiesTable(vulnerabilities []services.Vulnerability, multipleRoots, printExtended bool) error
- type OutputFormat
Constants ¶
This section is empty.
Variables ¶
var OutputFormats = []string{string(Table), string(Json), string(SimpleJson)}
Functions ¶
func CheckIfFailBuild ¶ added in v2.7.0
func CheckIfFailBuild(results []services.ScanResponse) bool
func DownloadIndexerIfNeeded ¶
func DownloadIndexerIfNeeded(xrayManager *xray.XrayServicesManager, xrayVersionStr string) (indexerPath string, err error)
func NewFailBuildError ¶ added in v2.7.0
func NewFailBuildError() error
func PrepareLicenses ¶ added in v2.12.2
func PrepareViolations ¶ added in v2.12.2
func PrepareViolations(violations []services.Violation, multipleRoots bool) ([]formats.VulnerabilityOrViolationRow, []formats.LicenseViolationRow, []formats.OperationalRiskViolationRow, error)
Prepare violations for all non-table formats (without style or emoji)
func PrepareVulnerabilities ¶ added in v2.12.2
func PrepareVulnerabilities(vulnerabilities []services.Vulnerability, multipleRoots bool) ([]formats.VulnerabilityOrViolationRow, error)
Prepare vulnerabilities for all non-table formats (without style or emoji)
func PrintLicensesTable ¶ added in v2.1.0
PrintLicensesTable prints the licenses in a table. Set multipleRoots to true in case the given licenses array contains (or may contain) results of several projects or files (like in binary scan). In case multipleRoots is true, the field Component will show the root of each impact path, otherwise it will show the root's child. Set printExtended to true to print fields with 'extended' tag.
func PrintScanResults ¶ added in v2.4.0
func PrintScanResults(results []services.ScanResponse, errors []formats.SimpleJsonError, format OutputFormat, includeVulnerabilities, includeLicenses, isMultipleRoots, printExtended bool) error
PrintScanResults prints Xray scan results in the given format. Note that errors are printed only on SimpleJson format.
func PrintViolationsTable ¶
PrintViolationsTable prints the violations in 4 tables: security violations, license compliance violations, operational risk violations and ignore rule URLs. Set multipleRoots to true in case the given violations array contains (or may contain) results of several projects or files (like in binary scan). In case multipleRoots is true, the field Component will show the root of each impact path, otherwise it will show the root's child. In case one (or more) of the violations contains the field FailBuild set to true, CliError with exit code 3 will be returned. Set printExtended to true to print fields with 'extended' tag.
func PrintVulnerabilitiesTable ¶
func PrintVulnerabilitiesTable(vulnerabilities []services.Vulnerability, multipleRoots, printExtended bool) error
PrintVulnerabilitiesTable prints the vulnerabilities in a table. Set multipleRoots to true in case the given vulnerabilities array contains (or may contain) results of several projects or files (like in binary scan). In case multipleRoots is true, the field Component will show the root of each impact path, otherwise it will show the root's child. Set printExtended to true to print fields with 'extended' tag.
Types ¶
type OutputFormat ¶ added in v2.7.0
type OutputFormat string
const ( // OutputFormat values Table OutputFormat = "table" Json OutputFormat = "json" SimpleJson OutputFormat = "simple-json" )