s3

package
v0.7.8 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrStorageDisabled = errors.New("storage is disabled")
	ErrMediaType       = errors.New("media type is not allowed")
)

Functions

func RandomKey

func RandomKey() (string, error)

Types

type MediaTypes

type MediaTypes struct {
	// contains filtered or unexported fields
}

func NewMediaTypes

func NewMediaTypes(mediaTypes map[string][]string) (MediaTypes, error)

func (*MediaTypes) IsAllowed

func (m *MediaTypes) IsAllowed(mediaType string) bool

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

func NewDisabledStorage

func NewDisabledStorage() *Storage

func NewStorage

func NewStorage(
	session *session.Session,
	bucket string,
	mediaTypes MediaTypes,
	ensureBucket bool,
	clientURL string,
) (*Storage, error)

func (*Storage) UploadFormData

func (s *Storage) UploadFormData(key string, contentType string) (map[string]string, error)

Jump to

Keyboard shortcuts

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