Documentation ¶
Index ¶
- Variables
- func Delete(ctx context.Context, info *types.StorageDetail) error
- func DeleteAll(ctx context.Context, info *types.StorageInfo) error
- func GetFile(ctx context.Context, detail *types.StorageDetail) ([]byte, error)
- func GetFileStream(ctx context.Context, detail *types.StorageDetail) (io.ReadCloser, error)
- func InitStorage()
- func Save(ctx context.Context, filePath string, storagePath string, ...) (*types.StorageDetail, error)
- func SaveAll(ctx context.Context, artwork *types.Artwork, picture *types.Picture) (*types.StorageInfo, error)
- type Storage
Constants ¶
This section is empty.
Variables ¶
View Source
var Storages = make(map[types.StorageType]Storage)
Functions ¶
func GetFileStream ¶ added in v0.60.0
func GetFileStream(ctx context.Context, detail *types.StorageDetail) (io.ReadCloser, error)
func InitStorage ¶
func InitStorage()
Types ¶
type Storage ¶
type Storage interface { Init() // filePath 本地文件路径, storagePath 存储路径. // // 存储实现可能会对传入的存储路径进行其他处理 (如添加前缀), 因此返回的 StorageDetail 中的 Path 可能与传入的 storagePath 不同. Save(ctx context.Context, filePath, storagePath string) (*types.StorageDetail, error) GetFile(ctx context.Context, info *types.StorageDetail) ([]byte, error) GetFileStream(ctx context.Context, info *types.StorageDetail) (io.ReadCloser, error) Delete(ctx context.Context, info *types.StorageDetail) error }
Click to show internal directories.
Click to hide internal directories.