You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

storage_load_package.go 696 B

1234567891011121314151617181920212223242526272829
  1. package task
  2. import (
  3. "time"
  4. "gitlink.org.cn/cloudream/common/pkgs/task"
  5. "gitlink.org.cn/cloudream/storage/common/pkgs/cmd"
  6. )
  7. type StorageLoadPackage struct {
  8. cmd *cmd.DownloadPackage
  9. FullPath string
  10. }
  11. func NewStorageLoadPackage(userID int64, packageID int64, outputPath string) *StorageLoadPackage {
  12. return &StorageLoadPackage{
  13. cmd: cmd.NewDownloadPackage(userID, packageID, outputPath),
  14. FullPath: outputPath,
  15. }
  16. }
  17. func (t *StorageLoadPackage) Execute(task *task.Task[TaskContext], ctx TaskContext, complete CompleteFn) {
  18. err := t.cmd.Execute(&cmd.DownloadPackageContext{
  19. Distlock: ctx.distlock,
  20. })
  21. complete(err, CompleteOption{
  22. RemovingDelay: time.Minute,
  23. })
  24. }

本项目旨在将云际存储公共基础设施化,使个人及企业可低门槛使用高效的云际存储服务(安装开箱即用云际存储客户端即可,无需关注其他组件的部署),同时支持用户灵活便捷定制云际存储的功能细节。