21 lines
893 B
Go
21 lines
893 B
Go
package s3manager
|
|
|
|
import (
|
|
"context"
|
|
"io"
|
|
|
|
"github.com/minio/minio-go/v7"
|
|
)
|
|
|
|
//go:generate moq -out mocks/s3.go -pkg mocks . S3
|
|
|
|
// S3 is a client to interact with S3 storage.
|
|
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
|
|
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
|
|
}
|