Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrStorageNameEmpty = errors.New("storage name is empty")
)
View Source
var Storages = make(map[string]Storage)
View Source
var UserStorages = make(map[int64][]Storage)
Functions ¶
func LoadStorages ¶ added in v0.11.0
func LoadStorages()
Types ¶
type Storage ¶
type Storage interface {
Init(cfg sc.StorageConfig) error
Type() types.StorageType
Name() string
JoinStoragePath(task types.Task) string
Save(ctx context.Context, reader io.Reader, storagePath string) error
}
func GetStorageByName ¶ added in v0.11.0
GetStorageByName returns storage by name from cache or creates new one
func GetStorageByUserIDAndName ¶ added in v0.11.0
检查 user 是否可用指定的 storage, 若不可用则返回未找到错误
func GetUserStorages ¶ added in v0.11.0
func NewStorage ¶ added in v0.11.0
func NewStorage(cfg sc.StorageConfig) (Storage, error)
type StorageConstructor ¶ added in v0.11.0
type StorageConstructor func() Storage
Click to show internal directories.
Click to hide internal directories.