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.

ipfs.go 1.0 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package agent
  2. import (
  3. "gitlink.org.cn/cloudream/common/pkg/mq"
  4. "gitlink.org.cn/cloudream/storage-common/pkgs/db/model"
  5. )
  6. type CheckIPFS struct {
  7. IsComplete bool `json:"isComplete"`
  8. Caches []model.Cache `json:"caches"`
  9. }
  10. func NewCheckIPFS(isComplete bool, caches []model.Cache) CheckIPFS {
  11. return CheckIPFS{
  12. IsComplete: isComplete,
  13. Caches: caches,
  14. }
  15. }
  16. type CheckIPFSResp struct {
  17. Entries []CheckIPFSRespEntry `json:"entries"`
  18. }
  19. const (
  20. CHECK_IPFS_RESP_OP_DELETE_TEMP = "DeleteTemp"
  21. CHECK_IPFS_RESP_OP_CREATE_TEMP = "CreateTemp"
  22. )
  23. type CheckIPFSRespEntry struct {
  24. FileHash string `json:"fileHash"`
  25. Operation string `json:"operation"`
  26. }
  27. func NewCheckIPFSRespEntry(fileHash string, op string) CheckIPFSRespEntry {
  28. return CheckIPFSRespEntry{
  29. FileHash: fileHash,
  30. Operation: op,
  31. }
  32. }
  33. func NewCheckIPFSResp(entries []CheckIPFSRespEntry) CheckIPFSResp {
  34. return CheckIPFSResp{
  35. Entries: entries,
  36. }
  37. }
  38. func init() {
  39. mq.RegisterMessage[CheckIPFS]()
  40. mq.RegisterMessage[CheckIPFSResp]()
  41. }

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