outputGenerator

package
v0.0.13-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2025 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FailureOutput

func FailureOutput(sbomAnalysisInfo types.AnalysisInfo, start time.Time) types.Output

FailureOutput generates an output object for a failed analysis. It takes the sbomAnalysisInfo pointer and the start time as parameters. It returns an output object with the analysis status set to FAILURE. The output object includes workspace data, analysis information, and error details.

func GenerateAnalysisStats

func GenerateAnalysisStats(workspaceData map[string]types.WorkspaceInfo) types.AnalysisStats

GenerateAnalysisStats calculates the analysis statistics based on the provided workspace data. It takes a map of workspace data, where the keys are workspace names and the values are pointers to WorkSpaceLicenseInfoInternal structs. The function iterates over the workspace data and counts the number of SPDX licenses, non-SPDX licenses, copy left licenses, and permissive licenses. It also generates a distribution map of licenses, where the keys are license names and the values are the number of occurrences. The function returns an AnalysisStats struct containing the calculated statistics.

func SuccessOutput

func SuccessOutput(workspaceData map[string]types.WorkspaceInfo, analysisStats types.AnalysisStats, sbomAnalysisInfo types.AnalysisInfo, start time.Time) types.Output

SuccessOutput generates the success output for the license analysis. It takes in the workspaceData, analysisStats, sbomAnalysisInfo, and start time as parameters. It returns an instance of types.Output containing the workspace data, analysis information, and timing details.

Types

This section is empty.

Jump to

Keyboard shortcuts

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