Implement s3 storage.

Use uuid as file id.
This commit is contained in:
2025-05-13 11:56:22 +08:00
parent 081b547c03
commit 04d679f3f4
14 changed files with 145 additions and 76 deletions

View File

@@ -13,9 +13,9 @@ var (
type IStorage interface {
// Upload uploads a file to the storage and returns the storage key.
Upload(filePath string) (string, error)
Upload(filePath string, fileName string) (string, error)
// Download return the download url of the file with the given storage key.
Download(storageKey string) (string, error)
Download(storageKey string, fileName string) (string, error)
// Delete deletes the file with the given storage key.
Delete(storageKey string) error
// ToString returns the storage configuration as a string.