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.

ops.go 1.7 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. package ops2
  2. import (
  3. "gitlink.org.cn/cloudream/common/pkgs/ioswitch/dag"
  4. "gitlink.org.cn/cloudream/common/pkgs/ioswitch/plan/ops"
  5. "gitlink.org.cn/cloudream/storage/common/pkgs/ioswitch2"
  6. )
  7. type GraphNodeBuilder struct {
  8. *ops.GraphNodeBuilder
  9. }
  10. func NewGraphNodeBuilder() *GraphNodeBuilder {
  11. return &GraphNodeBuilder{ops.NewGraphNodeBuilder()}
  12. }
  13. type FromNode interface {
  14. dag.Node
  15. GetFrom() ioswitch2.From
  16. Output() dag.StreamOutputSlot
  17. }
  18. type ToNode interface {
  19. dag.Node
  20. GetTo() ioswitch2.To
  21. Input() dag.StreamInputSlot
  22. SetInput(input *dag.StreamVar)
  23. }
  24. // func formatStreamIO(node *dag.Node) string {
  25. // is := ""
  26. // for i, in := range node.InputStreams {
  27. // if i > 0 {
  28. // is += ","
  29. // }
  30. // if in == nil {
  31. // is += "."
  32. // } else {
  33. // is += fmt.Sprintf("%v", in.ID)
  34. // }
  35. // }
  36. // os := ""
  37. // for i, out := range node.OutputStreams {
  38. // if i > 0
  39. // os += ","
  40. // }
  41. // if out == nil {
  42. // os += "."
  43. // } else {
  44. // os += fmt.Sprintf("%v", out.ID)
  45. // }
  46. // }
  47. // if is == "" && os == "" {
  48. // return ""
  49. // }
  50. // return fmt.Sprintf("S{%s>%s}", is, os)
  51. // }
  52. // func formatValueIO(node *dag.Node) string {
  53. // is := ""
  54. // for i, in := range node.InputValues {
  55. // if i > 0 {
  56. // is += ","
  57. // }
  58. // if in == nil {
  59. // is += "."
  60. // } else {
  61. // is += fmt.Sprintf("%v", in.ID)
  62. // }
  63. // }
  64. // os := ""
  65. // for i, out := range node.OutputValues {
  66. // if i > 0 {
  67. // os += ","
  68. // }
  69. // if out == nil {
  70. // os += "."
  71. // } else {
  72. // os += fmt.Sprintf("%v", out.ID)
  73. // }
  74. // }
  75. // if is == "" && os == "" {
  76. // return ""
  77. // }
  78. // return fmt.Sprintf("V{%s>%s}", is, os)
  79. // }

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