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 555 B

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

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