s3manager-web/internal/app/s3manager/s3.go
Lena Fuhrimann ca4237e462 Fix test
2023-06-13 18:34:54 +02:00

27 lines
944 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
}
type SSEType struct {
Type string
Key string
}