Documentation
¶
Overview ¶
Package storage persists ToolTrust Scanner results to a SQLite database. It uses modernc.org/sqlite — a pure-Go driver with no CGo dependency, making cross-compilation (linux/darwin/windows) straightforward.
Index ¶
- type ScanRecord
- type Store
- func (s *Store) Close() error
- func (s *Store) Count(ctx context.Context) (int, error)
- func (s *Store) Get(ctx context.Context, id string) (ScanRecord, error)
- func (s *Store) ListByGrade(ctx context.Context, grade model.Grade) ([]ScanRecord, error)
- func (s *Store) Save(ctx context.Context, r ScanRecord) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ScanRecord ¶
type ScanRecord struct {
ID string
ToolName string
Protocol model.ProtocolType
RiskScore int
Grade model.Grade
Findings []model.Issue
ScannedAt time.Time
}
ScanRecord is the persisted form of a single tool scan.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store wraps a SQLite connection and exposes scan-result persistence.
func Open ¶
Open opens (or creates) a SQLite database at dsn and runs the schema migration. Use ":memory:" for tests.
func OpenContext ¶
OpenContext is like Open but accepts an explicit context for the schema migration.
func (*Store) ListByGrade ¶
ListByGrade returns all scan records with the given grade, newest first.
Click to show internal directories.
Click to hide internal directories.