Documentation
¶
Overview ¶
Package screens provides one Screen value per command tab in the SBOM Utility GUI.
Each Screen follows the same structural pattern:
- A top bar with a FilePicker for the input BOM file.
- A collapsible SidePanel on the left containing command-specific flags/filters.
- A Run button that invokes the bridge layer on a goroutine to keep the UI responsive.
- A ResultsView filling the remaining space for tabular or text output.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppState ¶
type AppState struct {
// contains filtered or unexported fields
}
AppState holds application-wide state that is shared across all screens.
func (*AppState) BOMInfoValue ¶
BOMInfoValue returns the current BOMInfo snapshot.
func (*AppState) OnBOMFileChange ¶
OnBOMFileChange registers a callback that is invoked (on the caller's goroutine) whenever the BOM file path changes. It is called immediately with the current value so that newly-created screens are initialised correctly.
func (*AppState) OnBOMInfoChange ¶
OnBOMInfoChange registers a callback invoked whenever BOM metadata changes. It is called immediately with the current value.
func (*AppState) SetBOMFile ¶
SetBOMFile stores a new BOM file path and notifies all registered listeners.
func (*AppState) SetBOMInfo ¶
SetBOMInfo stores parsed BOM metadata and notifies registered info listeners.
type BOMInfo ¶
type BOMInfo struct {
// Format is the canonical BOM format name (e.g. "CycloneDX", "SPDX").
Format string
// SpecVersion is the spec/schema version declared in the BOM (e.g. "1.5").
SpecVersion string
// FilePath is the absolute path of the loaded file.
FilePath string
}
BOMInfo carries the metadata extracted from a loaded BOM file that is displayed in the status bar.
type ComponentScreen ¶
type ComponentScreen struct {
// contains filtered or unexported fields
}
ComponentScreen wraps the `component list` command.
func NewComponentScreen ¶
func NewComponentScreen() *ComponentScreen
func (*ComponentScreen) Activate ¶
func (s *ComponentScreen) Activate()
Activate executes the default component-list command if a BOM file is loaded.
func (*ComponentScreen) Layout ¶
func (s *ComponentScreen) Layout(_ fyne.Window, state *AppState) fyne.CanvasObject
type LicenseScreen ¶
type LicenseScreen struct {
// contains filtered or unexported fields
}
LicenseScreen wraps the `license list` command.
func NewLicenseScreen ¶
func NewLicenseScreen() *LicenseScreen
func (*LicenseScreen) Activate ¶
func (s *LicenseScreen) Activate()
Activate executes the default license-list command if a BOM file is loaded.
func (*LicenseScreen) Layout ¶
func (s *LicenseScreen) Layout(_ fyne.Window, state *AppState) fyne.CanvasObject
type LoadScreen ¶
type LoadScreen struct {
// contains filtered or unexported fields
}
LoadScreen owns the file-browse dialog and the JSON viewer shown in the main content area. It does NOT occupy a tab slot; its OpenDialog method is called directly from the sidebar load button in main.go.
func (*LoadScreen) ContentLayout ¶
func (s *LoadScreen) ContentLayout(w fyne.Window, state *AppState) fyne.CanvasObject
ContentLayout builds the main-area widget tree: a status label at the top and a scrollable JSON viewer below. It is embedded in the window content by main.go, not inside a TabItem.
func (*LoadScreen) OpenDialog ¶
func (s *LoadScreen) OpenDialog()
OpenDialog opens the Fyne file-open dialog.
type ResourceScreen ¶
type ResourceScreen struct {
// contains filtered or unexported fields
}
ResourceScreen wraps the `resource list` command.
func NewResourceScreen ¶
func NewResourceScreen() *ResourceScreen
func (*ResourceScreen) Activate ¶
func (s *ResourceScreen) Activate()
Activate executes the default resource-list command if a BOM file is loaded.
func (*ResourceScreen) Layout ¶
func (s *ResourceScreen) Layout(_ fyne.Window, state *AppState) fyne.CanvasObject
type Runner ¶
type Runner interface {
// Activate executes the screen's default command if a BOM file is loaded.
// It is a no-op when no file has been selected yet.
Activate()
}
Runner is implemented by any screen that can auto-execute when its tab is selected. main.go uses this to trigger a default run on tab-switch.
type ValidateScreen ¶
type ValidateScreen struct {
// contains filtered or unexported fields
}
ValidateScreen shows the validate command's controls and results.
func NewValidateScreen ¶
func NewValidateScreen() *ValidateScreen
NewValidateScreen allocates a ValidateScreen.
func (*ValidateScreen) Activate ¶
func (s *ValidateScreen) Activate()
Activate executes the validate command if a BOM file is loaded.
func (*ValidateScreen) Layout ¶
func (s *ValidateScreen) Layout(_ fyne.Window, state *AppState) fyne.CanvasObject
Layout constructs and returns the full screen CanvasObject.
type ViewScreen ¶
type ViewScreen struct {
// contains filtered or unexported fields
}
ViewScreen displays the raw contents of the loaded BOM file. It is the default screen shown after a BOM is loaded.
func (*ViewScreen) Activate ¶
func (s *ViewScreen) Activate()
Activate reloads and displays the BOM file contents.
func (*ViewScreen) Layout ¶
func (s *ViewScreen) Layout(_ fyne.Window, state *AppState) fyne.CanvasObject
Layout constructs and returns the full screen CanvasObject.
type VulnerabilityScreen ¶
type VulnerabilityScreen struct {
// contains filtered or unexported fields
}
VulnerabilityScreen wraps the `vulnerability list` command.
func NewVulnerabilityScreen ¶
func NewVulnerabilityScreen() *VulnerabilityScreen
func (*VulnerabilityScreen) Activate ¶
func (s *VulnerabilityScreen) Activate()
Activate executes the default vulnerability-list command if a BOM file is loaded.
func (*VulnerabilityScreen) Layout ¶
func (s *VulnerabilityScreen) Layout(_ fyne.Window, state *AppState) fyne.CanvasObject