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.

scanner.go 606 B

123456789101112131415161718192021222324252627282930
  1. package services
  2. import (
  3. "fmt"
  4. "gitlink.org.cn/cloudream/storage-common/globals"
  5. )
  6. type ScannerService struct {
  7. *Service
  8. }
  9. func (svc *Service) ScannerSvc() *ScannerService {
  10. return &ScannerService{Service: svc}
  11. }
  12. func (svc *ScannerService) PostEvent(event any, isEmergency bool, dontMerge bool) error {
  13. scCli, err := globals.ScannerMQPool.Acquire()
  14. if err != nil {
  15. return fmt.Errorf("new scacnner client: %w", err)
  16. }
  17. defer scCli.Close()
  18. err = scCli.PostEvent(event, isEmergency, dontMerge)
  19. if err != nil {
  20. return fmt.Errorf("request to scanner failed, err: %w", err)
  21. }
  22. return nil
  23. }

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