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.

service.go 2.1 kB

6 months ago
6 months ago
8 months ago
6 months ago
8 months ago
6 months ago
8 months ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. package services
  2. import (
  3. "gitlink.org.cn/cloudream/jcs-pub/client/internal/accessstat"
  4. "gitlink.org.cn/cloudream/jcs-pub/client/internal/db"
  5. "gitlink.org.cn/cloudream/jcs-pub/client/internal/downloader"
  6. "gitlink.org.cn/cloudream/jcs-pub/client/internal/downloader/strategy"
  7. "gitlink.org.cn/cloudream/jcs-pub/client/internal/metacache"
  8. "gitlink.org.cn/cloudream/jcs-pub/client/internal/mount"
  9. "gitlink.org.cn/cloudream/jcs-pub/client/internal/spacesyncer"
  10. "gitlink.org.cn/cloudream/jcs-pub/client/internal/ticktock"
  11. "gitlink.org.cn/cloudream/jcs-pub/client/internal/uploader"
  12. "gitlink.org.cn/cloudream/jcs-pub/common/pkgs/publock"
  13. "gitlink.org.cn/cloudream/jcs-pub/common/pkgs/storage/pool"
  14. "gitlink.org.cn/cloudream/jcs-pub/common/pkgs/sysevent"
  15. )
  16. // Service 结构体封装了分布锁服务和任务管理服务。
  17. type Service struct {
  18. PubLock *publock.Service
  19. Downloader *downloader.Downloader
  20. AccessStat *accessstat.AccessStat
  21. Uploader *uploader.Uploader
  22. StrategySelector *strategy.Selector
  23. UserSpaceMeta *metacache.UserSpaceMeta
  24. DB *db.DB
  25. EvtPub *sysevent.Publisher
  26. Mount *mount.Mount
  27. StgPool *pool.Pool
  28. SpaceSyncer *spacesyncer.SpaceSyncer
  29. TickTock *ticktock.TickTock
  30. }
  31. func NewService(
  32. publock *publock.Service,
  33. downloader *downloader.Downloader,
  34. accStat *accessstat.AccessStat,
  35. uploder *uploader.Uploader,
  36. strategySelector *strategy.Selector,
  37. userSpaceMeta *metacache.UserSpaceMeta,
  38. db *db.DB,
  39. evtPub *sysevent.Publisher,
  40. mount *mount.Mount,
  41. stgPool *pool.Pool,
  42. spaceSyncer *spacesyncer.SpaceSyncer,
  43. tickTock *ticktock.TickTock,
  44. ) *Service {
  45. return &Service{
  46. PubLock: publock,
  47. Downloader: downloader,
  48. AccessStat: accStat,
  49. Uploader: uploder,
  50. StrategySelector: strategySelector,
  51. UserSpaceMeta: userSpaceMeta,
  52. DB: db,
  53. EvtPub: evtPub,
  54. Mount: mount,
  55. StgPool: stgPool,
  56. SpaceSyncer: spaceSyncer,
  57. TickTock: tickTock,
  58. }
  59. }

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