s3

package
v0.0.0-...-fb83055 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 20 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ContextContentType = "UrlSignerContentType" //Values can be Audio, Video
)

Variables

View Source
var (
	ErrUrlSign         = commonerrors.NewError("Signing Error")
	ErrInvalidS3Domain = commonerrors.NewError("Invalid S3 Domain Name")
	ErrInvalidS3Path   = commonerrors.NewError("Invalid S3 Path")
	ErrMD5MisMatch     = commonerrors.NewError("MD5 mismatch")
)

Functions

func NewS3Service

func NewS3Service(s *session.Session, uploader *s3manager.Uploader, profile string, bucketName string, prefixPath string, region string, expireAfter time.Duration) *s3Service

Types

type S3Service

type S3Service interface {
	CreateBucket(bucketName string, region string) (responseFromAws *s3.CreateBucketOutput, err error)
	ListBucket(ctx context.Context) (responseFromAws *s3.ListBucketsOutput, err error)
	SimpleFileUploader(bucketName string, fileName string, contentType string, reader io.Reader) (fileUrl string, err error)
	UploadObjectIfModified(filePath string, s3Path string) (outS3Path string, err error)
	ListObjects() (*s3.ListObjectsV2Output, error)
	DownloadFolder(s3Path string, outPath string) (outS3Path string, err error)
	DeleteObject(name string) (*s3.DeleteObjectOutput, error)
	DownloadObject(name string)
	SignUrl(context context.Context, s3Url string) (signedUrl string, err error)
	BuildS3Url(relativeUrl string) string
}

Jump to

Keyboard shortcuts

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