s3storage

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: Apache-2.0 Imports: 14 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) Get added in v0.8.23

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

func (*S3Storage) Meta added in v0.9.0

func (s *S3Storage) Meta(ctx context.Context, image string) (meta *imagor.Meta, err 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