cache

package
v0.0.0-...-7d8c9fc Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVCache

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

CSVCache is deprecated - SQLite only

func NewCSVCache

func NewCSVCache(filepath string) *CSVCache

NewCSVCache creates a new CSV cache

func (*CSVCache) Clear

func (c *CSVCache) Clear() error

Clear clears the cache by removing the CSV file

func (*CSVCache) Close

func (c *CSVCache) Close() error

Close does nothing for CSV cache

func (*CSVCache) Load

func (c *CSVCache) Load() ([]sysdig.Vulnerability, error)

Load - CSV is deprecated, use SQLite

func (*CSVCache) Save

func (c *CSVCache) Save(vulnerabilities []sysdig.Vulnerability) error

Save - CSV is deprecated, use SQLite

type Cache

type Cache interface {
	Save(vulnerabilities []sysdig.Vulnerability) error
	Load() ([]sysdig.Vulnerability, error)
	Clear() error
	Close() error
}

Cache interface for vulnerability caching

func NewCache

func NewCache(cacheType CacheType, filepath string) (Cache, error)

NewCache creates a new cache instance based on the type

type CacheType

type CacheType string

CacheType represents the type of cache storage

const (
	CacheTypeSQLite CacheType = "sqlite"
	CacheTypeCSV    CacheType = "csv"
)

type SQLiteCache

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

SQLiteCache implements Cache interface using SQLite

func NewSQLiteCache

func NewSQLiteCache(filepath string) (*SQLiteCache, error)

NewSQLiteCache creates a new SQLite cache

func (*SQLiteCache) Clear

func (c *SQLiteCache) Clear() error

Clear clears the cache

func (*SQLiteCache) ClearScanResults

func (c *SQLiteCache) ClearScanResults(scanType string) error

ClearScanResults implements ScanResultCache interface for SQLiteCache

func (*SQLiteCache) Close

func (c *SQLiteCache) Close() error

Close closes the database connection

func (*SQLiteCache) Load

func (c *SQLiteCache) Load() ([]sysdig.Vulnerability, error)

Load loads vulnerabilities from SQLite database

func (*SQLiteCache) LoadScanResults

func (c *SQLiteCache) LoadScanResults(scanType string, days int) ([]ScanResultWithDetails, error)

LoadScanResults implements ScanResultCache interface for SQLiteCache

func (*SQLiteCache) Save

func (c *SQLiteCache) Save(vulnerabilities []sysdig.Vulnerability) error

Save saves vulnerabilities to SQLite database

func (*SQLiteCache) SaveScanResults

func (c *SQLiteCache) SaveScanResults(scanType string, results []sysdig.ScanResult, vulnerabilities map[string][]sysdig.Vulnerability) error

SaveScanResults implements ScanResultCache interface for SQLiteCache - V2 API only

type ScanResultCache

type ScanResultCache interface {
	SaveScanResults(scanType string, results []sysdig.ScanResult, vulnerabilities map[string][]sysdig.Vulnerability) error
	LoadScanResults(scanType string, days int) ([]ScanResultWithDetails, error)
	ClearScanResults(scanType string) error
	Close() error
}

ScanResultCache interface for scan result caching with detailed vulnerability info

func NewScanResultCache

func NewScanResultCache(filepath string) (ScanResultCache, error)

NewScanResultCache creates a new SQLite-based scan result cache

type ScanResultWithDetails

type ScanResultWithDetails struct {
	ScanResult      sysdig.ScanResult
	Vulnerabilities []sysdig.Vulnerability
}

ScanResultWithDetails combines scan result with its detailed vulnerability info

Jump to

Keyboard shortcuts

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