mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 07:02:26 -05:00
[chore] bump gruf/go-store to v2 (#953)
* [chore] bump gruf/go-store to v2 * no more boobs
This commit is contained in:
parent
a9addb59b6
commit
bcb80d3ff4
105 changed files with 12360 additions and 4859 deletions
|
|
@ -23,8 +23,8 @@ import (
|
|||
"io"
|
||||
"net/url"
|
||||
|
||||
"codeberg.org/gruf/go-store/kv"
|
||||
"codeberg.org/gruf/go-store/storage"
|
||||
"codeberg.org/gruf/go-store/v2/kv"
|
||||
"codeberg.org/gruf/go-store/v2/storage"
|
||||
)
|
||||
|
||||
type Local struct {
|
||||
|
|
@ -32,15 +32,15 @@ type Local struct {
|
|||
}
|
||||
|
||||
func (l *Local) Get(ctx context.Context, key string) ([]byte, error) {
|
||||
return l.KVStore.Get(key)
|
||||
return l.KVStore.Get(ctx, key)
|
||||
}
|
||||
|
||||
func (l *Local) GetStream(ctx context.Context, key string) (io.ReadCloser, error) {
|
||||
return l.KVStore.GetStream(key)
|
||||
return l.KVStore.GetStream(ctx, key)
|
||||
}
|
||||
|
||||
func (l *Local) PutStream(ctx context.Context, key string, r io.Reader) error {
|
||||
err := l.KVStore.PutStream(key, r)
|
||||
err := l.KVStore.PutStream(ctx, key, r)
|
||||
if err == storage.ErrAlreadyExists {
|
||||
return ErrAlreadyExists
|
||||
}
|
||||
|
|
@ -48,7 +48,7 @@ func (l *Local) PutStream(ctx context.Context, key string, r io.Reader) error {
|
|||
}
|
||||
|
||||
func (l *Local) Put(ctx context.Context, key string, value []byte) error {
|
||||
err := l.KVStore.Put(key, value)
|
||||
err := l.KVStore.Put(ctx, key, value)
|
||||
if err == storage.ErrAlreadyExists {
|
||||
return ErrAlreadyExists
|
||||
}
|
||||
|
|
@ -56,7 +56,7 @@ func (l *Local) Put(ctx context.Context, key string, value []byte) error {
|
|||
}
|
||||
|
||||
func (l *Local) Delete(ctx context.Context, key string) error {
|
||||
return l.KVStore.Delete(key)
|
||||
return l.KVStore.Delete(ctx, key)
|
||||
}
|
||||
|
||||
func (l *Local) URL(ctx context.Context, key string) *url.URL {
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ import (
|
|||
"net/url"
|
||||
"path"
|
||||
|
||||
"codeberg.org/gruf/go-store/kv"
|
||||
"codeberg.org/gruf/go-store/storage"
|
||||
"codeberg.org/gruf/go-store/v2/kv"
|
||||
"codeberg.org/gruf/go-store/v2/storage"
|
||||
"github.com/minio/minio-go/v7"
|
||||
"github.com/minio/minio-go/v7/pkg/credentials"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
|
|
@ -60,7 +60,7 @@ func AutoConfig() (Driver, error) {
|
|||
return NewS3(mc, config.GetStorageS3BucketName()), nil
|
||||
case "local":
|
||||
storageBasePath := config.GetStorageLocalBasePath()
|
||||
storage, err := kv.OpenFile(storageBasePath, &storage.DiskConfig{
|
||||
storage, err := kv.OpenDisk(storageBasePath, &storage.DiskConfig{
|
||||
// Put the store lockfile in the storage dir itself.
|
||||
// Normally this would not be safe, since we could end up
|
||||
// overwriting the lockfile if we store a file called 'store.lock'.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue