Documentation
¶
Index ¶
- func EnrichFromVuln(entry *PackageEntry, vuln *malindex.Vulnerability)
- func FeedTime(e PackageEntry) time.Time
- func FormatShare(share float64) string
- func InFeedWindow(e PackageEntry, since time.Time) bool
- func SortPackageEntriesByPublished(entries []PackageEntry)
- type CorpusStats
- type CountBucket
- type PackageEntry
- type WindowStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnrichFromVuln ¶
func EnrichFromVuln(entry *PackageEntry, vuln *malindex.Vulnerability)
EnrichFromVuln fills display fields on entry from vuln.
func FeedTime ¶
func FeedTime(e PackageEntry) time.Time
FeedTime is the disclosure timestamp used for --since filtering, sorting, dashboard age buckets, and card header badges (published date only).
func FormatShare ¶
FormatShare returns a short percent string for display.
func InFeedWindow ¶
func InFeedWindow(e PackageEntry, since time.Time) bool
InFeedWindow reports whether e was published on or after since.
func SortPackageEntriesByPublished ¶
func SortPackageEntriesByPublished(entries []PackageEntry)
SortPackageEntriesByPublished sorts entries newest-published-first.
Types ¶
type CorpusStats ¶
type CorpusStats struct {
Source string `json:"source,omitempty"`
IndexedPackages int `json:"indexed_packages,omitempty"`
LastSync string `json:"last_sync,omitempty"`
PendingSync int `json:"pending_sync,omitempty"`
}
CorpusStats describes the local malicious-package index snapshot.
type CountBucket ¶
CountBucket is a labeled count with optional share (0–100).
type PackageEntry ¶
type PackageEntry struct {
Ecosystem string `json:"ecosystem"`
Name string `json:"name"`
Version string `json:"version,omitempty"`
PackageURL string `json:"registry_url,omitempty"`
IDs []string `json:"ids"`
Aliases []string `json:"aliases,omitempty"`
ModifiedAt time.Time `json:"modified_at"`
Published time.Time `json:"published_at,omitempty"`
ImportedAt time.Time `json:"imported_at,omitempty"`
Summary string `json:"summary,omitempty"`
Withdrawn bool `json:"withdrawn"`
Quarantined bool `json:"quarantined,omitempty"`
}
func EntryFromVuln ¶
func EntryFromVuln(v *malindex.Vulnerability) PackageEntry
EntryFromVuln builds a display entry from a full OSV record.
func FilterPackageEntriesByFeedTime ¶
func FilterPackageEntriesByFeedTime(entries []PackageEntry, since time.Time) []PackageEntry
FilterPackageEntriesByFeedTime keeps entries published within the active window.
type WindowStats ¶
type WindowStats struct {
Advisories int `json:"advisories"`
UniquePackages int `json:"unique_packages"`
Ecosystems []CountBucket `json:"ecosystems,omitempty"`
Namespaces []CountBucket `json:"namespaces,omitempty"`
Age []CountBucket `json:"age,omitempty"`
Withdrawn int `json:"withdrawn"`
WithAliases int `json:"with_aliases"`
}
WindowStats aggregates feed entries in the active --since window.
func ComputeWindowStats ¶
func ComputeWindowStats(entries []PackageEntry) WindowStats
ComputeWindowStats builds dashboard metrics from all entries in the feed window.