Documentation ¶
Index ¶
- type FileStorage
- func (s *FileStorage) Delete(_ context.Context, image string) error
- func (s *FileStorage) Get(_ *http.Request, image string) (*imagor.Blob, error)
- func (s *FileStorage) Path(image string) (string, bool)
- func (s *FileStorage) Put(_ context.Context, image string, blob *imagor.Blob) (err error)
- func (s *FileStorage) Stat(_ context.Context, image string) (stat *imagor.Stat, err error)
- type Option
- func WithBlacklist(blacklist *regexp.Regexp) Option
- func WithExpiration(exp time.Duration) Option
- func WithMkdirPermission(perm string) Option
- func WithPathPrefix(prefix string) Option
- func WithSafeChars(chars string) Option
- func WithSaveErrIfExists(saveErrIfExists bool) Option
- func WithWritePermission(perm string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileStorage ¶
type FileStorage struct { BaseDir string PathPrefix string Blacklists []*regexp.Regexp MkdirPermission os.FileMode WritePermission os.FileMode SaveErrIfExists bool SafeChars string Expiration time.Duration // contains filtered or unexported fields }
FileStorage File Storage implements imagor.Storage interface
func (*FileStorage) Delete ¶ added in v0.9.6
func (s *FileStorage) Delete(_ context.Context, image string) error
Delete implements imagor.Storage interface
func (*FileStorage) Path ¶
func (s *FileStorage) Path(image string) (string, bool)
Path transforms and validates image key for storage path
type Option ¶
type Option func(h *FileStorage)
Option FileStorage option
func WithBlacklist ¶
WithBlacklist with regexp path blacklist option
func WithExpiration ¶ added in v0.8.10
WithExpiration with modified time expiration option
func WithMkdirPermission ¶
WithMkdirPermission with mkdir permission option
func WithPathPrefix ¶
WithPathPrefix with path prefix option
func WithSaveErrIfExists ¶
WithSaveErrIfExists with save error if exists option
func WithWritePermission ¶
WithWritePermission with write permission option
Click to show internal directories.
Click to hide internal directories.