filestorage

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

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

func (*FileStorage) Get added in v0.8.23

func (s *FileStorage) Get(r *http.Request, image string) (*imagor.Blob, error)

func (*FileStorage) Path

func (s *FileStorage) Path(image string) (string, bool)

func (*FileStorage) Put added in v0.8.23

func (s *FileStorage) Put(_ context.Context, image string, blob *imagor.Blob) (err error)

func (*FileStorage) Stat added in v0.8.23

func (s *FileStorage) Stat(ctx context.Context, image string) (stat *imagor.Stat, err error)

type Option

type Option func(h *FileStorage)

func WithBlacklist

func WithBlacklist(blacklist *regexp.Regexp) Option

func WithExpiration added in v0.8.10

func WithExpiration(exp time.Duration) Option

func WithMkdirPermission

func WithMkdirPermission(perm string) Option

func WithPathPrefix

func WithPathPrefix(prefix string) Option

func WithSafeChars

func WithSafeChars(chars string) Option

func WithSaveErrIfExists

func WithSaveErrIfExists(saveErrIfExists bool) Option

func WithWritePermission

func WithWritePermission(perm string) Option

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL