27 lines
1.2 KiB
Go
27 lines
1.2 KiB
Go
|
|
package minio
|
||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
"io"
|
||
|
|
"net/url"
|
||
|
|
"time"
|
||
|
|
|
||
|
|
miniogo "github.com/minio/minio-go/v7"
|
||
|
|
)
|
||
|
|
|
||
|
|
// Provider is the MinIO operation interface for the most common bucket operations.
|
||
|
|
// Inject it into repositories; call Native() on Component for SDK operations not covered here.
|
||
|
|
type Provider interface {
|
||
|
|
// PutObject uploads an object to the given bucket and key.
|
||
|
|
PutObject(ctx context.Context, bucket, key string, reader io.Reader, size int64, opts miniogo.PutObjectOptions) (miniogo.UploadInfo, error)
|
||
|
|
// RemoveObject deletes an object from the given bucket and key.
|
||
|
|
RemoveObject(ctx context.Context, bucket, key string, opts miniogo.RemoveObjectOptions) error
|
||
|
|
// GetObject downloads an object and returns it as a readable stream.
|
||
|
|
// The caller must close the returned object after reading.
|
||
|
|
GetObject(ctx context.Context, bucket, key string, opts miniogo.GetObjectOptions) (*miniogo.Object, error)
|
||
|
|
// PresignedGetObject returns a pre-signed URL for downloading an object.
|
||
|
|
PresignedGetObject(ctx context.Context, bucket, key string, expires time.Duration, reqParams url.Values) (*url.URL, error)
|
||
|
|
// HandleError maps a minio-go error to a typed xerrors value.
|
||
|
|
HandleError(err error) error
|
||
|
|
}
|