bump go-store version (includes minio) (#1657)

Signed-off-by: kim <grufwub@gmail.com>
This commit is contained in:
kim
2023-03-30 22:39:55 +01:00
committed by GitHub
parent 0746ef741a
commit a5c920a50b
33 changed files with 14876 additions and 8512 deletions

View File

@@ -195,7 +195,7 @@ func (st *DiskStorage) ReadBytes(ctx context.Context, key string) ([]byte, error
// ReadStream implements Storage.ReadStream().
func (st *DiskStorage) ReadStream(ctx context.Context, key string) (io.ReadCloser, error) {
// Get file path for key
kpath, err := st.filepath(key)
kpath, err := st.Filepath(key)
if err != nil {
return nil, err
}
@@ -235,7 +235,7 @@ func (st *DiskStorage) WriteBytes(ctx context.Context, key string, value []byte)
// WriteStream implements Storage.WriteStream().
func (st *DiskStorage) WriteStream(ctx context.Context, key string, r io.Reader) (int64, error) {
// Get file path for key
kpath, err := st.filepath(key)
kpath, err := st.Filepath(key)
if err != nil {
return 0, err
}
@@ -291,7 +291,7 @@ func (st *DiskStorage) WriteStream(ctx context.Context, key string, r io.Reader)
// Stat implements Storage.Stat().
func (st *DiskStorage) Stat(ctx context.Context, key string) (bool, error) {
// Get file path for key
kpath, err := st.filepath(key)
kpath, err := st.Filepath(key)
if err != nil {
return false, err
}
@@ -313,7 +313,7 @@ func (st *DiskStorage) Stat(ctx context.Context, key string) (bool, error) {
// Remove implements Storage.Remove().
func (st *DiskStorage) Remove(ctx context.Context, key string) error {
// Get file path for key
kpath, err := st.filepath(key)
kpath, err := st.Filepath(key)
if err != nil {
return err
}
@@ -384,8 +384,8 @@ func (st *DiskStorage) WalkKeys(ctx context.Context, opts WalkKeysOptions) error
})
}
// filepath checks and returns a formatted filepath for given key.
func (st *DiskStorage) filepath(key string) (string, error) {
// Filepath checks and returns a formatted Filepath for given key.
func (st *DiskStorage) Filepath(key string) (string, error) {
// Calculate transformed key path
key = st.config.Transform.KeyToPath(key)

View File

@@ -15,6 +15,7 @@ var DefaultS3Config = &S3Config{
CoreOpts: minio.Options{},
GetOpts: minio.GetObjectOptions{},
PutOpts: minio.PutObjectOptions{},
PutChunkOpts: minio.PutObjectPartOptions{},
PutChunkSize: 4 * 1024 * 1024, // 4MiB
StatOpts: minio.StatObjectOptions{},
RemoveOpts: minio.RemoveObjectOptions{},
@@ -37,6 +38,9 @@ type S3Config struct {
// a byte stream reader of unknown size as a multi-part object.
PutChunkSize int64
// PutChunkOpts are S3 client options passed during chunked .Write___() calls.
PutChunkOpts minio.PutObjectPartOptions
// StatOpts are S3 client options passed during .Stat() calls.
StatOpts minio.StatObjectOptions
@@ -251,9 +255,7 @@ loop:
index,
rbuf,
int64(n),
"",
"",
nil,
st.config.PutChunkOpts,
)
if err != nil {
return 0, err