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.

download_package.go 630 B

2 years ago
123456789101112131415161718192021222324252627
  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 DownloadPackage struct {
  8. cmd *cmd.DownloadPackage
  9. }
  10. func NewDownloadPackage(userID int64, packageID int64, outputPath string) *DownloadPackage {
  11. return &DownloadPackage{
  12. cmd: cmd.NewDownloadPackage(userID, packageID, outputPath),
  13. }
  14. }
  15. func (t *DownloadPackage) Execute(task *task.Task[TaskContext], ctx TaskContext, complete CompleteFn) {
  16. err := t.cmd.Execute(&cmd.DownloadPackageContext{
  17. Distlock: ctx.distlock,
  18. })
  19. complete(err, CompleteOption{
  20. RemovingDelay: time.Minute,
  21. })
  22. }

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