s3storage

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(h *S3Storage)

func WithACL

func WithACL(acl string) Option

func WithBaseDir

func WithBaseDir(baseDir string) Option

func WithExpiration added in v0.8.10

func WithExpiration(exp time.Duration) Option

func WithPathPrefix

func WithPathPrefix(prefix string) Option

func WithSafeChars

func WithSafeChars(chars string) Option

type S3Storage

type S3Storage struct {
	S3         *s3.S3
	Uploader   *s3manager.Uploader
	Downloader *s3manager.Downloader
	Bucket     string

	BaseDir    string
	PathPrefix string
	ACL        string
	SafeChars  string
	Expiration time.Duration
	// contains filtered or unexported fields
}

func New

func New(sess *session.Session, bucket string, options ...Option) *S3Storage

func (*S3Storage) Delete added in v0.9.6

func (s *S3Storage) Delete(ctx context.Context, image string) error

func (*S3Storage) Get added in v0.8.23

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

func (*S3Storage) Path

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

func (*S3Storage) Put added in v0.8.23

func (s *S3Storage) Put(ctx context.Context, image string, blob *imagor.Blob) error

func (*S3Storage) Stat added in v0.8.23

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

Jump to

Keyboard shortcuts

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