s3storage

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 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 WithPathPrefix

func WithPathPrefix(prefix string) Option

func WithSafeChars

func WithSafeChars(chars string) Option

type S3Storage

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

	BaseDir    string
	PathPrefix string
	ACL        string
	SafeChars  string
	// contains filtered or unexported fields
}

func New

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

func (*S3Storage) Load

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

func (*S3Storage) Path

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

func (*S3Storage) Save

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

Jump to

Keyboard shortcuts

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