feat: image variants cache panel
This commit is contained in:
1 parent
951fef18ba
commit
d768668014
53 files changed
+5809
-46
No files matched your search
@@ -1,6 +1,9 @@
|
||||
package image
|
||||
|
||||
import "io"
|
||||
import (
|
||||
"io"
|
||||
"time"
|
||||
)
|
||||
|
||||
type VariantRepository interface {
|
||||
List() ([]Variant, error)
|
||||
@@ -20,6 +23,23 @@ type VariantFileRepository interface {
|
||||
TotalsBySource() (map[string]VariantFileTotals, error)
|
||||
}
|
||||
|
||||
type VariantCacheRepository interface {
|
||||
UnusedTotals(filter UnusedFilter) (VariantFileTotals, error)
|
||||
TopSources(limit int) ([]SourceTotals, error)
|
||||
ListPage(filter VariantFileFilter, afterID uint32, limit int) ([]VariantFile, error)
|
||||
}
|
||||
|
||||
type VariantUsageRepository interface {
|
||||
Record(batch VariantUsageBatch) error
|
||||
RejectedSince(day time.Time) (int, error)
|
||||
}
|
||||
|
||||
type VariantUsageTracker interface {
|
||||
RecordHit(variantName string, sourceName string)
|
||||
RecordRejection()
|
||||
Flush() error
|
||||
}
|
||||
|
||||
type RenderedVariant struct {
|
||||
Content []byte
|
||||
ContentType string
|
||||
|
||||
Reference in new issue
Block a user