s3manager-web/internal/app/s3manager/s3.go

30 lines
1.1 KiB
Go
Raw Normal View History

2017-05-08 23:07:07 +02:00
package s3manager
2017-04-02 17:10:36 +02:00
import (
2021-08-05 11:44:40 +02:00
"context"
2017-04-02 17:10:36 +02:00
"io"
2023-08-20 14:03:02 +02:00
"net/url"
"time"
2017-04-02 17:10:36 +02:00
2021-08-05 11:44:40 +02:00
"github.com/minio/minio-go/v7"
2017-04-02 17:10:36 +02:00
)
2018-08-12 15:13:07 +02:00
//go:generate moq -out mocks/s3.go -pkg mocks . S3
2018-04-24 22:35:21 +02:00
2017-05-08 23:07:07 +02:00
// S3 is a client to interact with S3 storage.
type S3 interface {
2021-08-05 11:44:40 +02:00
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
2023-08-20 14:03:02 +02:00
PresignedGetObject(ctx context.Context, bucketName, objectName string, expiry time.Duration, reqParams url.Values) (*url.URL, error)
2021-08-05 11:44:40 +02:00
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
2017-04-02 17:10:36 +02:00
}
2023-02-09 12:05:14 +01:00
type SSEType struct {
Type string
2023-06-13 18:34:54 +02:00
Key string
}