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

2 years ago
2 years ago
2 years ago
2 years ago
1234567891011121314151617181920212223242526
  1. package mq
  2. import (
  3. "gitlink.org.cn/cloudream/storage/agent/internal/task"
  4. "gitlink.org.cn/cloudream/storage/common/pkgs/ioswitch"
  5. )
  6. // Service 表示一个消息队列服务
  7. // 它包含了任务管理和IO切换器两个核心组件
  8. type Service struct {
  9. taskManager *task.Manager // taskManager 用于管理和调度任务
  10. sw *ioswitch.Switch // sw 用于控制IO切换
  11. }
  12. // NewService 创建一个新的消息队列服务实例
  13. // 参数:
  14. // - taskMgr:任务管理器,负责任务的调度和管理
  15. // - sw:IO切换器,用于控制数据的输入输出
  16. // 返回值:
  17. // - *Service:指向创建的消息队列服务实例的指针
  18. func NewService(taskMgr *task.Manager, sw *ioswitch.Switch) *Service {
  19. return &Service{
  20. taskManager: taskMgr,
  21. sw: sw,
  22. }
  23. }

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