s3manager

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package s3manager allows to interact with an S3 compatible storage.

Index

Constants

View Source
const (
	ErrBucketDoesNotExist = "The specified bucket does not exist"
	ErrKeyDoesNotExist    = "The specified key does not exist"
)

Error codes that may be returned from an S3 client.

Variables

This section is empty.

Functions

func HandleBucketView

func HandleBucketView(s3 S3, templates fs.FS, allowDelete bool, listRecursive bool) http.HandlerFunc

HandleBucketView shows the details page of a bucket.

func HandleBucketsView

func HandleBucketsView(s3 S3, templates fs.FS, allowDelete bool) http.HandlerFunc

HandleBucketsView renders all buckets on an HTML page.

func HandleCreateBucket

func HandleCreateBucket(s3 S3) http.HandlerFunc

HandleCreateBucket creates a new bucket.

func HandleCreateObject

func HandleCreateObject(s3 S3, sseInfo SSEType) http.HandlerFunc

HandleCreateObject uploads a new object.

func HandleDeleteBucket

func HandleDeleteBucket(s3 S3) http.HandlerFunc

HandleDeleteBucket deletes a bucket.

func HandleDeleteObject

func HandleDeleteObject(s3 S3) http.HandlerFunc

HandleDeleteObject deletes an object.

func HandleGenerateUrl added in v0.5.0

func HandleGenerateUrl(s3 S3) http.HandlerFunc

func HandleGetObject

func HandleGetObject(s3 S3, forceDownload bool) http.HandlerFunc

HandleGetObject downloads an object to the client.

Types

type S3

type S3 interface {
	GetObject(ctx context.Context, bucketName, objectName string, opts minio.GetObjectOptions) (*minio.Object, error)
	ListBuckets(ctx context.Context) ([]minio.BucketInfo, error)
	ListObjects(ctx context.Context, bucketName string, opts minio.ListObjectsOptions) <-chan minio.ObjectInfo
	MakeBucket(ctx context.Context, bucketName string, opts minio.MakeBucketOptions) error
	PresignedGetObject(ctx context.Context, bucketName, objectName string, expiry time.Duration, reqParams url.Values) (*url.URL, error)
	PutObject(ctx context.Context, bucketName, objectName string, reader io.Reader, objectSize int64, opts minio.PutObjectOptions) (minio.UploadInfo, error)
	RemoveBucket(ctx context.Context, bucketName string) error
	RemoveObject(ctx context.Context, bucketName, objectName string, opts minio.RemoveObjectOptions) error
}

S3 is a client to interact with S3 storage.

type SSEType

type SSEType struct {
	Type string
	Key  string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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