Documentation
¶
Overview ¶
Package bridge provides thin wrappers that translate GUI inputs into the exact same function calls the CLI cobra commands use, by mutating the shared utils.GlobalFlags state that every cmd.* function reads from.
This means the GUI always has feature parity with the CLI at zero extra cost: any improvement to a cmd function is automatically available in the GUI.
Index ¶
- func ListComponentsText(p ComponentParams) (string, error)
- func ListLicensesText(p LicenseParams) (string, error)
- func ListResourcesText(p ResourceParams) (string, error)
- func ListVulnerabilitiesText(p VulnerabilityParams) (string, error)
- type BOMInfo
- type ComponentParams
- type LicenseParams
- type ResourceParams
- type ValidateParams
- type ValidateResult
- type VulnerabilityParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListComponentsText ¶
func ListComponentsText(p ComponentParams) (string, error)
func ListLicensesText ¶
func ListLicensesText(p LicenseParams) (string, error)
ListLicensesText captures tabular output as a string for display.
func ListResourcesText ¶
func ListResourcesText(p ResourceParams) (string, error)
func ListVulnerabilitiesText ¶
func ListVulnerabilitiesText(p VulnerabilityParams) (string, error)
Types ¶
type BOMInfo ¶
type BOMInfo struct {
// SpecVersion is the CycloneDX specVersion declared in the BOM
// (e.g. "1.5"). Empty if detection failed.
SpecVersion string
// Format is the canonical format name (e.g. "CycloneDX").
Format string
// FilePath is the absolute path of the loaded BOM file.
FilePath string
}
BOMInfo holds the metadata extracted when a BOM file is first loaded.
func LoadBOMInfo ¶
LoadBOMInfo parses the BOM file at filePath just enough to detect its format and schema version. It is safe to call from a goroutine.
type ComponentParams ¶
ComponentParams mirrors the flags on `component list`.
type LicenseParams ¶
type LicenseParams struct {
InputFile string
Summary bool
OutputFormat string // "txt", "csv", "json", "md"
WhereRaw string // raw "key=regex,key=regex" string
}
LicenseParams mirrors the flags exposed on the `license list` CLI command.
type ResourceParams ¶
type ResourceParams struct {
InputFile string
ResourceType string // "", "component", "service"
OutputFormat string
WhereRaw string
}
ResourceParams mirrors the flags on `resource list`.
type ValidateParams ¶
type ValidateParams struct {
InputFile string
SchemaVariant string
ForceSchema string
MaxErrors int
ShowValues bool
}
ValidateParams mirrors the flags exposed on the `validate` CLI command.
type ValidateResult ¶
type ValidateResult struct {
Valid bool
SchemaErrors []gojsonschema.ResultError
Output string // text representation of errors
Err error
}
ValidateResult is what the GUI renders after a validate run.
func RunValidate ¶
func RunValidate(p ValidateParams) ValidateResult
RunValidate sets GlobalFlags from params and calls the real Validate().