tui

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SortDefault  = ""
	SortSeverity = "severity"
	SortPath     = "path"
	SortDetector = "detector"
)

SortColumn constants

View Source
const (
	GroupNone       = "none"
	GroupByFile     = "file"
	GroupByDetector = "detector"
)

GroupMode constants

Variables

This section is empty.

Functions

func Run

func Run(findings []types.Finding, rescanFunc func() ([]types.Finding, error)) error

func RunCached

func RunCached(findings []types.Finding, rescanFunc func() ([]types.Finding, error), timestamp time.Time) error

func RunCachedWithBaseline

func RunCachedWithBaseline(findings []types.Finding, baseline report.Baseline, rescanFunc func() ([]types.Finding, error), timestamp time.Time) error

func RunWithBaseline

func RunWithBaseline(findings []types.Finding, baseline report.Baseline, rescanFunc func() ([]types.Finding, error)) error

func SavePrefs

func SavePrefs(prefs Prefs) error

SavePrefs persists user preferences to disk.

Types

type BlameInfo

type BlameInfo struct {
	Author string
	Date   string
	Commit string
}

type GroupedItem

type GroupedItem struct {
	IsGroup    bool           // True if this is a group header
	GroupKey   string         // Group identifier (file path or detector name)
	GroupCount int            // Number of findings in this group
	Finding    *types.Finding // Non-nil if this is a finding row
}

GroupedItem represents either a group header or a finding in the grouped view

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model represents the main state of the TUI application.

func NewModel

func NewModel(findings []types.Finding, rescanFunc func() ([]types.Finding, error)) Model

NewModel initializes a new TUI model.

func NewModelWithBaseline

func NewModelWithBaseline(findings []types.Finding, baseline report.Baseline, rescanFunc func() ([]types.Finding, error)) Model

NewModelWithBaseline initializes a TUI model with baseline awareness.

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Model) View

func (m Model) View() string

type Prefs

type Prefs struct {
	// HideSecrets controls whether secret values are redacted in the display.
	// Defaults to true for security (prevents shoulder surfing).
	HideSecrets bool `json:"hide_secrets"`
	// StoreRawAudit controls whether audit logs store raw match/secret values.
	// Defaults to false for security.
	StoreRawAudit bool `json:"store_raw_audit"`
}

Prefs holds user preferences for the TUI that persist across sessions.

func DefaultPrefs

func DefaultPrefs() Prefs

DefaultPrefs returns the default preferences.

func LoadPrefs

func LoadPrefs() Prefs

LoadPrefs loads user preferences from disk, returning defaults if not found.

Jump to

Keyboard shortcuts

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