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.

agent.go 754 B

2 years ago
2 years ago
1234567891011121314151617181920212223242526272829
  1. package mq
  2. import (
  3. "gitlink.org.cn/cloudream/common/pkgs/logger"
  4. "gitlink.org.cn/cloudream/common/pkgs/mq"
  5. "gitlink.org.cn/cloudream/storage/common/consts"
  6. stgglb "gitlink.org.cn/cloudream/storage/common/globals"
  7. agtmq "gitlink.org.cn/cloudream/storage/common/pkgs/mq/agent"
  8. )
  9. func (svc *Service) GetState(msg *agtmq.GetState) (*agtmq.GetStateResp, *mq.CodeMessage) {
  10. var ipfsState string
  11. ipfsCli, err := stgglb.IPFSPool.Acquire()
  12. if err != nil {
  13. logger.Warnf("new ipfs client: %s", err.Error())
  14. ipfsState = consts.IPFSStateUnavailable
  15. } else {
  16. if ipfsCli.IsUp() {
  17. ipfsState = consts.IPFSStateOK
  18. } else {
  19. ipfsState = consts.IPFSStateUnavailable
  20. }
  21. ipfsCli.Close()
  22. }
  23. return mq.ReplyOK(agtmq.NewGetStateResp(ipfsState))
  24. }

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