Documentation ¶
Index ¶
- Constants
- Variables
- type Dir
- type FlushOptions
- type GenerateOptions
- type Image
- type NamingStrategy
- type NamingStrategyPattern
- type NamingStrategySerial
- type Storage
- func (s *Storage) AddImageFromBlob(ctx context.Context, blob []byte, dirName string, options GenerateOptions) (int, error)
- func (s *Storage) AddImageFromFile(ctx context.Context, file string, dirName string, options GenerateOptions) (int, error)
- func (s *Storage) ChangeImageName(ctx context.Context, imageID int, options GenerateOptions) error
- func (s *Storage) Flop(imageID int) error
- func (s *Storage) Flush(options FlushOptions) error
- func (s *Storage) FormattedImage(ctx context.Context, id int, formatName string) (*Image, error)
- func (s *Storage) FormattedImages(ctx context.Context, imageIds []int, formatName string) (map[int]Image, error)
- func (s *Storage) Image(ctx context.Context, id int) (*Image, error)
- func (s *Storage) Normalize(imageID int) error
- func (s *Storage) RemoveImage(imageID int) error
- func (s *Storage) SetImageCrop(imageID int, crop sampler.Crop) error
Constants ¶
View Source
const ( NamingStrategyTypeSerial string = "serial" NamingStrategyTypePattern string = "pattern" )
View Source
const ( StatusDefault int = 0 StatusProcessing int = 1 StatusFailed int = 2 )
View Source
const ItemPerDir = 1000
Variables ¶
View Source
var ErrImageNotFound = errors.New("image not found")
Functions ¶
This section is empty.
Types ¶
type Dir ¶
type Dir struct {
// contains filtered or unexported fields
}
func NewDir ¶
func NewDir(bucket string, config config.ImageStorageNamingStrategyConfig) (*Dir, error)
func (*Dir) NamingStrategy ¶
func (d *Dir) NamingStrategy() NamingStrategy
type FlushOptions ¶
type GenerateOptions ¶
type NamingStrategy ¶
type NamingStrategy interface {
Generate(GenerateOptions) string
}
type NamingStrategyPattern ¶
type NamingStrategyPattern struct{}
func (NamingStrategyPattern) Generate ¶
func (s NamingStrategyPattern) Generate(options GenerateOptions) string
type NamingStrategySerial ¶
type NamingStrategySerial struct {
// contains filtered or unexported fields
}
func (NamingStrategySerial) Generate ¶
func (s NamingStrategySerial) Generate(options GenerateOptions) string
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func NewStorage ¶
func NewStorage(db *goqu.Database, config config.ImageStorageConfig) (*Storage, error)
func (*Storage) AddImageFromBlob ¶
func (*Storage) AddImageFromFile ¶
func (*Storage) ChangeImageName ¶
func (*Storage) Flush ¶
func (s *Storage) Flush(options FlushOptions) error
func (*Storage) FormattedImage ¶
func (*Storage) FormattedImages ¶
func (*Storage) RemoveImage ¶
Click to show internal directories.
Click to hide internal directories.