mirror of
https://github.com/krau/SaveAny-Bot.git
synced 2026-06-28 02:31:34 +08:00
feat: add stream upload support and related configurations
This commit is contained in:
@@ -3,6 +3,7 @@ package storage
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/krau/SaveAny-Bot/config"
|
||||
"github.com/krau/SaveAny-Bot/logger"
|
||||
@@ -20,6 +21,11 @@ type Storage interface {
|
||||
Save(cttx context.Context, localFilePath, storagePath string) error
|
||||
}
|
||||
|
||||
type StreamStorage interface {
|
||||
Storage
|
||||
NewUploadStream(ctx context.Context, path string) (io.WriteCloser, error)
|
||||
}
|
||||
|
||||
var Storages = make(map[string]Storage)
|
||||
|
||||
var UserStorages = make(map[int64][]Storage)
|
||||
|
||||
Reference in New Issue
Block a user