ui

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: Apache-2.0 Imports: 26 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Emerald = lipgloss.NewStyle().Foreground(lipgloss.Color("#34d399"))
View Source
var Gray = lipgloss.NewStyle().Foreground(lipgloss.Color("#cccccc"))
View Source
var Pantone = lipgloss.NewStyle().Foreground(lipgloss.Color("#6667ab"))
View Source
var Red = lipgloss.NewStyle().Foreground(lipgloss.Color("#ff0000"))
View Source
var White = lipgloss.NewStyle().Foreground(lipgloss.Color("#ffffff"))

Functions

func AdvisoryBackupsList added in v1.2.0

func AdvisoryBackupsList(backups []sdk.AdvisoryBackupMeta) error

func AdvisoryFeedsList added in v1.2.0

func AdvisoryFeedsList(rows []AdvisoryFeedRow, withBackups bool) error

func AdvisoryList added in v1.2.0

func AdvisoryList(records []sdk.AdvisoryRecordView) error

func BackupsList added in v1.2.0

func BackupsList(backups []sdk.BackupsMeta) error

BackupsList renders the v3 backup catalogue (GET /v3/backup).

Href is deliberately not a column: it is api.vulncheck.com/v3/backup/<name> for every row, so it spends a third of the terminal width restating the name. --json still carries it.

func CacheResults added in v0.9.0

func CacheResults(results []cache.IndexInfo) error

func ClearScreen added in v0.6.1

func ClearScreen()

func CpeMeta

func CpeMeta(cpe sdk.CpeMeta) error

func Danger

func Danger(str string) error

func Download

func Download(url string, filename string) error

func DownloadHeadless added in v1.0.0

func DownloadHeadless(ctx context.Context, url, filename string, progressOut io.Writer) error

DownloadHeadless streams url to filename using ctx for cancellation and emits coarse progress lines to progressOut (typically the renderer's stderr). It is the non-TUI counterpart to Download: no bubbletea, no TTY requirement, no panic on missing content length. Use when --json, --no-interactive, or a non-TTY stdout makes the bubbletea path unsafe.

func Error

func Error(args ...interface{}) error

func FlagErrorWrap

func FlagErrorWrap(err error) error

FlagErrorWrap FlagError returns a new FlagError that wraps the specified error.

func IndicesBrowse

func IndicesBrowse(indices []sdk.IndicesMeta, search string) (string, error)

func IndicesList

func IndicesList(indices []sdk.IndicesMeta, search string) error

func IndicesRows

func IndicesRows(indices []sdk.IndicesMeta, search string) []table.Row

func Info

func Info(str string)

func Json

func Json(data interface{})

func JsonFile added in v0.2.4

func JsonFile(data interface{}, filename string) error

func NewProgress

func NewProgress(total int)

Start a new progress bar

func PurlInstance added in v0.7.3

func PurlInstance(purl packageurl.PackageURL) error

func PurlMeta

func PurlMeta(purl sdk.PurlMeta) error

func PurlVulns

func PurlVulns(vulns []sdk.PurlVulnerability) error

func ScanResults

func ScanResults(results []models.ScanResultVulnerabilities, hideScores bool) error

func SingleColumnResults added in v0.5.1

func SingleColumnResults(results []string, title string) error

func Stat

func Stat(label string, value string)

func Success

func Success(str string)

func TermHeight

func TermHeight() int

func TermWidth

func TermWidth() int

func TokensBrowse added in v0.6.1

func TokensBrowse(tokens []sdk.TokenData) (string, error)

func TokensList added in v0.6.1

func TokensList(tokens []sdk.TokenData) error

func TokensRows added in v0.6.1

func TokensRows(tokens []sdk.TokenData) []table.Row

func UpdateProgress

func UpdateProgress(value int)

func Viewport

func Viewport(index string, data interface{})

Types

type AdvisoryFeedRow added in v1.2.0

type AdvisoryFeedRow struct {
	Name string `json:"name"`
	// Href is carried through from the API payload rather than dropped, so this
	// row stays a superset of what /v4/advisory/list returned.
	Href string `json:"href"`
	// Available is nil when the backup join was unavailable, so a consumer can
	// tell "no backup" apart from "we could not find out".
	// No omitempty on either: v4 backup is a separate entitlement from v4
	// advisory, so omitting them would make the JSON shape depend on the
	// caller's token tier. The keys are always present, and a null Available
	// means the backup list could not be read.
	Available       *bool  `json:"available"`
	BackupWrittenAt string `json:"backup_written_at"`
}

AdvisoryFeedRow pairs a feed with its backup availability.

The v4 feed list is only {name, href} -- there is no description, which is the column that makes the v3 index catalogue worth rendering -- so the backup columns are what give this table something to say.

func AdvisoryFeeds added in v1.2.0

func AdvisoryFeeds(feeds []sdk.AdvisoryFeedMeta, backups []sdk.AdvisoryBackupMeta, search string) []AdvisoryFeedRow

AdvisoryFeeds joins the feed catalogue with backup availability.

backups may be nil: v4 backup is a separate entitlement from v4 advisory (a trial grants the latter but not the former), so the join is best-effort and the caller passes nil when /v4/backup was refused. Rendering then degrades to the name column rather than failing a discovery command the user is entitled to run.

type FlagError

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

func (*FlagError) Error

func (fe *FlagError) Error() string

func (*FlagError) Unwrap

func (fe *FlagError) Unwrap() error

Jump to

Keyboard shortcuts

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