Documentation ¶
Index ¶
- Constants
- Variables
- func NewInPlaceInfo(res remediation.InPlaceResult) *inPlaceInfo
- func NewRelockInfo(change resolution.ResolutionDiff) *relockInfo
- func NewSpinner() spinner.Model
- func NewVulnInfo(vuln *resolution.ResolutionVuln) *vulnInfo
- func NewVulnList(vulns []*resolution.ResolutionVuln, preamble string) *vulnList
- func RenderSelectorOption(selected bool, cursor string, format string, args ...any) string
- func RenderSeverity(severities []models.Severity) string
- func RenderSeverityShort(severities []models.Severity) string
- type ChainGraph
- type KeyMap
- type ViewModel
- type ViewModelCloseMsg
Constants ¶
View Source
const ( ViewMinHeight = 20 // the minimum internal height the view can be ViewVPad = 1 // the vertical padding of the view ViewMinWidth = 60 // the minimum internal width the view can be ViewWidthPct = 0.4 // percentage of terminal internal width the main view should occupy ViewHPad = 2 // the horizontal padding of the view )
View dimensions width / height refers to the internal text area of the view i.e. excluding the border and the padding
Variables ¶
View Source
var ( ColorPrimary = lipgloss.Color("#e62129") // Red, from the OSV logo :) ColorDisabled = lipgloss.AdaptiveColor{Light: "250", Dark: "238"} // Grey )
View Source
var ( SelectedTextStyle = lipgloss.NewStyle().Foreground(ColorPrimary) DisabledTextStyle = lipgloss.NewStyle().Foreground(ColorDisabled) )
View Source
var CloseViewModel tea.Cmd = func() tea.Msg { return ViewModelCloseMsg{} }
View Source
var Keys = KeyMap{ Up: key.NewBinding( key.WithKeys("up"), key.WithHelp("↑", "move up"), ), Down: key.NewBinding( key.WithKeys("down"), key.WithHelp("↓", "move down"), ), Left: key.NewBinding( key.WithKeys("left"), ), Right: key.NewBinding( key.WithKeys("right"), ), Select: key.NewBinding( key.WithKeys("enter"), key.WithHelp("enter", "select option"), ), SwitchView: key.NewBinding( key.WithKeys("tab", "i"), key.WithHelp("i/tab", "switch views"), ), Help: key.NewBinding( key.WithKeys("h"), key.WithHelp("h", "toggle help"), ), Quit: key.NewBinding( key.WithKeys("q", "esc"), key.WithHelp("q/esc", "exit"), ), }
Functions ¶
func NewInPlaceInfo ¶
func NewInPlaceInfo(res remediation.InPlaceResult) *inPlaceInfo
func NewRelockInfo ¶
func NewRelockInfo(change resolution.ResolutionDiff) *relockInfo
func NewVulnInfo ¶
func NewVulnInfo(vuln *resolution.ResolutionVuln) *vulnInfo
func NewVulnList ¶
func NewVulnList(vulns []*resolution.ResolutionVuln, preamble string) *vulnList
func RenderSelectorOption ¶
Inline selector renderer, for layouts that don't fit neatly into a list/table
func RenderSeverity ¶
func RenderSeverityShort ¶
Types ¶
type ChainGraph ¶
type ChainGraph struct {
// contains filtered or unexported fields
}
func FindChainGraphs ¶
func FindChainGraphs(chains []resolution.DependencyChain) []ChainGraph
for each unique vulnerable node, construct the graph from that node to each connected direct dependency, choosing only the shortest path
func (ChainGraph) String ¶
func (c ChainGraph) String() string
type KeyMap ¶
type KeyMap struct { Up key.Binding Down key.Binding Left key.Binding Right key.Binding Select key.Binding SwitchView key.Binding Help key.Binding Quit key.Binding }
Key bindings
type ViewModel ¶
type ViewModel interface { Update(msg tea.Msg) (ViewModel, tea.Cmd) View() string Resize(w, h int) }
tea-like model for representing the secondary info panel Allows for resizing
type ViewModelCloseMsg ¶
type ViewModelCloseMsg struct{}
Msg and Cmd to use to quit out of the ViewModel
Click to show internal directories.
Click to hide internal directories.