bridge

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

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

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

func LoadBOMInfo(filePath string) BOMInfo

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

type ComponentParams struct {
	InputFile    string
	Summary      bool
	OutputFormat string
	WhereRaw     string
}

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().

type VulnerabilityParams

type VulnerabilityParams struct {
	InputFile    string
	Summary      bool
	OutputFormat string
	WhereRaw     string
}

VulnerabilityParams mirrors the flags on `vulnerability list`.

Jump to

Keyboard shortcuts

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