mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
bump go-store version (includes minio) (#1657)
Signed-off-by: kim <grufwub@gmail.com>
This commit is contained in:
12
vendor/codeberg.org/gruf/go-store/v2/storage/disk.go
generated
vendored
12
vendor/codeberg.org/gruf/go-store/v2/storage/disk.go
generated
vendored
@@ -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)
|
||||
|
||||
|
8
vendor/codeberg.org/gruf/go-store/v2/storage/s3.go
generated
vendored
8
vendor/codeberg.org/gruf/go-store/v2/storage/s3.go
generated
vendored
@@ -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
|
||||
|
Reference in New Issue
Block a user