mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-13 21:30:46 +02:00
* feat(storage): add local file storage fallback
- Add local storage implementation for file uploads
- Update .env.example with LOCAL_UPLOAD_DIR and LOCAL_UPLOAD_BASE_URL
- Integrate local storage into server router and handlers
- Add storage abstraction layer with util functions
* ♻️ refactor(storage): improve path handling and file serving
switch from path to filepath for better cross-platform support and replace manual file serving logic with http.ServeFile to enhance security against path traversal. update unit tests to use t.Setenv for cleaner environment variable management.
13 lines
297 B
Go
13 lines
297 B
Go
package storage
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
type Storage interface {
|
|
Upload(ctx context.Context, key string, data []byte, contentType string, filename string) (string, error)
|
|
Delete(ctx context.Context, key string)
|
|
DeleteKeys(ctx context.Context, keys []string)
|
|
KeyFromURL(rawURL string) string
|
|
}
|