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"
|
|
|
|
|
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
|
|
|
|
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
|
|
|
}
|