feat: image variants engine
This commit is contained in:
1 parent
f0845de643
commit
f1d56ef50e
80 files changed
+7312
-84
No files matched your search
@@ -0,0 +1,31 @@
|
||||
package image
|
||||
|
||||
import "io"
|
||||
|
||||
type VariantRepository interface {
|
||||
List() ([]Variant, error)
|
||||
Get(name string) (Variant, error)
|
||||
Create(variant Variant) (Variant, error)
|
||||
Update(variant Variant) (Variant, error)
|
||||
Delete(name string) error
|
||||
}
|
||||
|
||||
type VariantFileRepository interface {
|
||||
Find(variantName string, sourceName string) (VariantFile, bool, error)
|
||||
Save(file VariantFile) (VariantFile, error)
|
||||
ListByVariant(variantName string) ([]VariantFile, error)
|
||||
ListBySource(sourceName string) ([]VariantFile, error)
|
||||
Delete(id uint32) error
|
||||
Totals() (map[string]VariantFileTotals, error)
|
||||
}
|
||||
|
||||
type RenderedVariant struct {
|
||||
Content []byte
|
||||
ContentType string
|
||||
}
|
||||
|
||||
type VariantRenderer interface {
|
||||
DeclaredSize(source io.Reader) (width int, height int, err error)
|
||||
Render(source io.Reader, settings VariantSettings) (RenderedVariant, error)
|
||||
EncodableFormats() []VariantFormat
|
||||
}
|
||||
Reference in new issue
Block a user