Documentation ¶
Index ¶
- Variables
- type BackwardCompatibleS3Storage
- func (s *BackwardCompatibleS3Storage) BuildKey(key string) string
- func (s *BackwardCompatibleS3Storage) Fetch(key string) (*Object, error)
- func (s *BackwardCompatibleS3Storage) List(key string) ([]StorageItem, error)
- func (s *BackwardCompatibleS3Storage) Move(from string, to string) error
- func (s *BackwardCompatibleS3Storage) Open() error
- func (s *BackwardCompatibleS3Storage) Put(key string, imageFile io.ReadSeeker, contentType string, ...) error
- func (s *BackwardCompatibleS3Storage) PutFromBlob(key string, image []byte, contentType string, metadata map[string]string) error
- type BackwardCompatibleS3StorageItem
- type ErrInvalidStorageOption
- type FileStorage
- func (s *FileStorage) BuildKey(key string) string
- func (s *FileStorage) Fetch(key string) (*Object, error)
- func (s *FileStorage) List(key string) ([]StorageItem, error)
- func (s *FileStorage) Move(from string, to string) error
- func (s *FileStorage) Open() error
- func (s *FileStorage) Put(key string, imageFile io.ReadSeeker, contentType string, ...) error
- func (s *FileStorage) PutFromBlob(key string, image []byte, contentType string, metadata map[string]string) error
- type FileStorageItem
- type Object
- type S3Storage
- func (s *S3Storage) BuildKey(key string) string
- func (s *S3Storage) Fetch(key string) (*Object, error)
- func (s *S3Storage) List(key string) ([]StorageItem, error)
- func (s *S3Storage) Move(from string, to string) error
- func (s *S3Storage) Open() error
- func (s *S3Storage) Put(key string, imageFile io.ReadSeeker, contentType string, ...) error
- func (s *S3Storage) PutFromBlob(key string, image []byte, contentType string, metadata map[string]string) error
- type S3StorageItem
- type Storage
- type StorageItem
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AvailableStorageTypes = []string{"S3", "File"} ErrUnknownStorage = errors.New("specify unknown storage.") )
View Source
var (
ErrImageNotFound = errors.New("not found requested image")
)
Functions ¶
This section is empty.
Types ¶
type BackwardCompatibleS3Storage ¶
type BackwardCompatibleS3Storage struct { Storage // contains filtered or unexported fields }
func (*BackwardCompatibleS3Storage) BuildKey ¶
func (s *BackwardCompatibleS3Storage) BuildKey(key string) string
func (*BackwardCompatibleS3Storage) Fetch ¶
func (s *BackwardCompatibleS3Storage) Fetch(key string) (*Object, error)
func (*BackwardCompatibleS3Storage) List ¶
func (s *BackwardCompatibleS3Storage) List(key string) ([]StorageItem, error)
func (*BackwardCompatibleS3Storage) Move ¶
func (s *BackwardCompatibleS3Storage) Move(from string, to string) error
func (*BackwardCompatibleS3Storage) Open ¶
func (s *BackwardCompatibleS3Storage) Open() error
func (*BackwardCompatibleS3Storage) Put ¶
func (s *BackwardCompatibleS3Storage) Put(key string, imageFile io.ReadSeeker, contentType string, metadata map[string]string) error
func (*BackwardCompatibleS3Storage) PutFromBlob ¶
type BackwardCompatibleS3StorageItem ¶
type BackwardCompatibleS3StorageItem struct { StorageItem Object *s3.Object }
func (*BackwardCompatibleS3StorageItem) Extension ¶
func (s *BackwardCompatibleS3StorageItem) Extension() string
func (*BackwardCompatibleS3StorageItem) Filename ¶
func (s *BackwardCompatibleS3StorageItem) Filename() string
func (*BackwardCompatibleS3StorageItem) ImageSize ¶
func (s *BackwardCompatibleS3StorageItem) ImageSize() string
KeyFormat: :image_type/:id/:id.original.:date.:format or :image_type/:id/:id.:format
func (*BackwardCompatibleS3StorageItem) IsValid ¶
func (s *BackwardCompatibleS3StorageItem) IsValid() bool
func (*BackwardCompatibleS3StorageItem) Key ¶
func (s *BackwardCompatibleS3StorageItem) Key() string
type ErrInvalidStorageOption ¶
type ErrInvalidStorageOption struct { Message string // contains filtered or unexported fields }
func (*ErrInvalidStorageOption) Error ¶
func (e *ErrInvalidStorageOption) Error() string
type FileStorage ¶
type FileStorage struct { Storage // contains filtered or unexported fields }
func (*FileStorage) BuildKey ¶
func (s *FileStorage) BuildKey(key string) string
func (*FileStorage) List ¶
func (s *FileStorage) List(key string) ([]StorageItem, error)
func (*FileStorage) Open ¶
func (s *FileStorage) Open() error
func (*FileStorage) Put ¶
func (s *FileStorage) Put(key string, imageFile io.ReadSeeker, contentType string, metadata map[string]string) error
func (*FileStorage) PutFromBlob ¶
type FileStorageItem ¶
type FileStorageItem struct { StorageItem Name string }
func (*FileStorageItem) Extension ¶
func (s *FileStorageItem) Extension() string
func (*FileStorageItem) Filename ¶
func (s *FileStorageItem) Filename() string
func (*FileStorageItem) ImageSize ¶
func (s *FileStorageItem) ImageSize() string
KeyFormat: :image_type/:id/:id.:size.:format
func (*FileStorageItem) IsValid ¶
func (s *FileStorageItem) IsValid() bool
func (*FileStorageItem) Key ¶
func (s *FileStorageItem) Key() string
type S3Storage ¶
type S3Storage struct { Storage // contains filtered or unexported fields }
type S3StorageItem ¶
type S3StorageItem struct { StorageItem Object *s3.Object }
func (*S3StorageItem) Extension ¶
func (s *S3StorageItem) Extension() string
func (*S3StorageItem) Filename ¶
func (s *S3StorageItem) Filename() string
func (*S3StorageItem) ImageSize ¶
func (s *S3StorageItem) ImageSize() string
KeyFormat: :image_type/:id/:id.:size.:format
func (*S3StorageItem) IsValid ¶
func (s *S3StorageItem) IsValid() bool
func (*S3StorageItem) Key ¶
func (s *S3StorageItem) Key() string
type Storage ¶
type Storage interface { Open() error Fetch(key string) (*Object, error) PutFromBlob(key string, image []byte, contentType string, metadata map[string]string) error Put(key string, imageFile io.ReadSeeker, contentType string, metadata map[string]string) error List(key string) ([]StorageItem, error) Move(from string, to string) error }
Click to show internal directories.
Click to hide internal directories.