This commit is contained in:
2026-01-02 15:29:43 +00:00
parent 1cbf6c5d9e
commit c6edad4402
34 changed files with 2842 additions and 449 deletions
+19
View File
@@ -56,6 +56,12 @@ type MetadataStore interface {
// Health checks metadata store health
Health(ctx context.Context) error
// GetTimeSeriesStats returns time-series download statistics
GetTimeSeriesStats(ctx context.Context, period string, registry string) (*TimeSeriesStats, error)
// AggregateDownloadData aggregates raw download events and cleans up old data
AggregateDownloadData(ctx context.Context) error
// Close closes the metadata store
Close() error
}
@@ -144,6 +150,19 @@ type Stats struct {
LastUpdated time.Time `json:"last_updated"`
}
// TimeSeriesDataPoint represents a single data point in time-series
type TimeSeriesDataPoint struct {
Timestamp time.Time `json:"timestamp"`
Value int64 `json:"value"`
}
// TimeSeriesStats represents time-series download statistics
type TimeSeriesStats struct {
Period string `json:"period"` // 1h, 1day, 7day, 30day
Registry string `json:"registry"` // empty string for all registries
DataPoints []*TimeSeriesDataPoint `json:"data_points"`
}
// CVEBypass represents a temporary bypass for a CVE or package
type CVEBypass struct {
ID string `json:"id"` // Unique bypass ID