cache

package
v0.1.5-beta Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache handles local caching of scan results and CVE data

func NewCache

func NewCache() (*Cache, error)

NewCache creates a new cache instance

func (*Cache) Cleanup

func (c *Cache) Cleanup() error

Cleanup removes expired cache entries

func (*Cache) Close

func (c *Cache) Close() error

Close closes the cache database

func (*Cache) GetCVEData

func (c *Cache) GetCVEData(pkg, version, ecosystem string) (string, error)

GetCVEData retrieves cached CVE data

func (*Cache) GetMetadata

func (c *Cache) GetMetadata(pkg, version, ecosystem string) (string, error)

GetMetadata retrieves cached metadata

func (*Cache) GetScanResult

func (c *Cache) GetScanResult(pkg, version, ecosystem string) (*CachedScanResult, error)

GetScanResult retrieves a cached scan result

func (*Cache) GetStats

func (c *Cache) GetStats() (*CacheStats, error)

GetStats returns cache statistics

func (*Cache) SetCVEData

func (c *Cache) SetCVEData(pkg, version, ecosystem, cveData string) error

SetCVEData stores CVE data in cache

func (*Cache) SetMetadata

func (c *Cache) SetMetadata(pkg, version, ecosystem, metadata string) error

SetMetadata stores metadata in cache

func (*Cache) SetScanResult

func (c *Cache) SetScanResult(pkg, version, ecosystem string, findingsJSON string, clean bool) error

SetScanResult stores a scan result in cache

type CacheStats

type CacheStats struct {
	ScanResults     int
	CVEEntries      int
	MetadataEntries int
	SizeBytes       int64
}

CacheStats represents cache statistics

type CachedScanResult

type CachedScanResult struct {
	Package      string
	Version      string
	Ecosystem    string
	FindingsJSON string
	Clean        bool
	ScannedAt    time.Time
}

CachedScanResult represents a cached scan result

Jump to

Keyboard shortcuts

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