基本功能实现

This commit is contained in:
2026-01-26 21:53:34 +08:00
commit c6e5e655f9
28 changed files with 4803 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
package storage
import (
"context"
"io"
)
type StoredObject struct {
Key string
ContentType string
Size int64
PublicURL string
}
type Storage interface {
Put(ctx context.Context, key string, r io.Reader, contentType string) (StoredObject, error)
Get(ctx context.Context, key string) (io.ReadCloser, string, error)
Delete(ctx context.Context, key string) error
PublicURL(key string) (string, bool)
}
var GlobalStorage Storage
func InitStorage() error {
// 实际初始化在 main.go 中根据配置调用对应的初始化函数
return nil
}