Documentation
¶
Index ¶
- Variables
- func AdvisoryBackupsList(backups []sdk.AdvisoryBackupMeta) error
- func AdvisoryFeedsList(rows []AdvisoryFeedRow, withBackups bool) error
- func AdvisoryList(records []sdk.AdvisoryRecordView) error
- func BackupsList(backups []sdk.BackupsMeta) error
- func CacheResults(results []cache.IndexInfo) error
- func ClearScreen()
- func CpeMeta(cpe sdk.CpeMeta) error
- func Danger(str string) error
- func Download(url string, filename string) error
- func DownloadHeadless(ctx context.Context, url, filename string, progressOut io.Writer) error
- func Error(args ...interface{}) error
- func FlagErrorWrap(err error) error
- func IndicesBrowse(indices []sdk.IndicesMeta, search string) (string, error)
- func IndicesList(indices []sdk.IndicesMeta, search string) error
- func IndicesRows(indices []sdk.IndicesMeta, search string) []table.Row
- func Info(str string)
- func Json(data interface{})
- func JsonFile(data interface{}, filename string) error
- func NewProgress(total int)
- func PurlInstance(purl packageurl.PackageURL) error
- func PurlMeta(purl sdk.PurlMeta) error
- func PurlVulns(vulns []sdk.PurlVulnerability) error
- func ScanResults(results []models.ScanResultVulnerabilities, hideScores bool) error
- func SingleColumnResults(results []string, title string) error
- func Stat(label string, value string)
- func Success(str string)
- func TermHeight() int
- func TermWidth() int
- func TokensBrowse(tokens []sdk.TokenData) (string, error)
- func TokensList(tokens []sdk.TokenData) error
- func TokensRows(tokens []sdk.TokenData) []table.Row
- func UpdateProgress(value int)
- func Viewport(index string, data interface{})
- type AdvisoryFeedRow
- type FlagError
Constants ¶
This section is empty.
Variables ¶
var Emerald = lipgloss.NewStyle().Foreground(lipgloss.Color("#34d399"))
var Gray = lipgloss.NewStyle().Foreground(lipgloss.Color("#cccccc"))
var Pantone = lipgloss.NewStyle().Foreground(lipgloss.Color("#6667ab"))
var Red = lipgloss.NewStyle().Foreground(lipgloss.Color("#ff0000"))
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 ClearScreen ¶ added in v0.6.1
func ClearScreen()
func DownloadHeadless ¶ added in v1.0.0
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 FlagErrorWrap ¶
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 PurlInstance ¶ added in v0.7.3
func PurlInstance(purl packageurl.PackageURL) 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 TermHeight ¶
func TermHeight() int
func TokensList ¶ added in v0.6.1
func UpdateProgress ¶
func UpdateProgress(value int)
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.