diff options
Diffstat (limited to 'vendor/codeberg.org/gruf')
| -rw-r--r-- | vendor/codeberg.org/gruf/go-store/v2/storage/disk.go | 12 | ||||
| -rw-r--r-- | vendor/codeberg.org/gruf/go-store/v2/storage/s3.go | 8 | 
2 files changed, 11 insertions, 9 deletions
diff --git a/vendor/codeberg.org/gruf/go-store/v2/storage/disk.go b/vendor/codeberg.org/gruf/go-store/v2/storage/disk.go index 21dba7671..3104400f3 100644 --- a/vendor/codeberg.org/gruf/go-store/v2/storage/disk.go +++ b/vendor/codeberg.org/gruf/go-store/v2/storage/disk.go @@ -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) diff --git a/vendor/codeberg.org/gruf/go-store/v2/storage/s3.go b/vendor/codeberg.org/gruf/go-store/v2/storage/s3.go index 501de230d..965fe0d4f 100644 --- a/vendor/codeberg.org/gruf/go-store/v2/storage/s3.go +++ b/vendor/codeberg.org/gruf/go-store/v2/storage/s3.go @@ -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  | 
