Documentation ¶
Index ¶
- type FileStorage
- func (s *FileStorage) Delete(_ context.Context, image string) error
- func (s *FileStorage) Get(r *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(ctx 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 }
func New ¶
func New(baseDir string, options ...Option) *FileStorage
func (*FileStorage) Delete ¶ added in v0.9.6
func (s *FileStorage) Delete(_ context.Context, image string) error
type Option ¶
type Option func(h *FileStorage)
func WithBlacklist ¶
func WithExpiration ¶ added in v0.8.10
func WithMkdirPermission ¶
func WithPathPrefix ¶
func WithSafeChars ¶
func WithSaveErrIfExists ¶
func WithWritePermission ¶
Click to show internal directories.
Click to hide internal directories.