Documentation ¶
Overview ¶
Package s3manager allows to interact with an S3 compatible storage.
Index ¶
- Constants
- func HandleBucketView(s3 S3, templates fs.FS, allowDelete bool, listRecursive bool) http.HandlerFunc
- func HandleBucketsView(s3 S3, templates fs.FS, allowDelete bool) http.HandlerFunc
- func HandleCreateBucket(s3 S3) http.HandlerFunc
- func HandleCreateObject(s3 S3, sseInfo SSEType) http.HandlerFunc
- func HandleDeleteBucket(s3 S3) http.HandlerFunc
- func HandleDeleteObject(s3 S3) http.HandlerFunc
- func HandleGenerateUrl(s3 S3) http.HandlerFunc
- func HandleGetObject(s3 S3, forceDownload bool) http.HandlerFunc
- type S3
- type SSEType
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 ¶
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.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.