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.5 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. )
  6. type GraphNodeBuilder struct {
  7. *ops.GraphNodeBuilder
  8. }
  9. func NewGraphNodeBuilder() *GraphNodeBuilder {
  10. return &GraphNodeBuilder{ops.NewGraphNodeBuilder()}
  11. }
  12. type FromNode interface {
  13. dag.Node
  14. Output() dag.StreamSlot
  15. }
  16. type ToNode interface {
  17. dag.Node
  18. Input() dag.StreamSlot
  19. SetInput(input *dag.StreamVar)
  20. }
  21. // func formatStreamIO(node *dag.Node) string {
  22. // is := ""
  23. // for i, in := range node.InputStreams {
  24. // if i > 0 {
  25. // is += ","
  26. // }
  27. // if in == nil {
  28. // is += "."
  29. // } else {
  30. // is += fmt.Sprintf("%v", in.ID)
  31. // }
  32. // }
  33. // os := ""
  34. // for i, out := range node.OutputStreams {
  35. // if i > ops
  36. // os += ","
  37. // }
  38. // if out == nil {
  39. // os += "."
  40. // } else {
  41. // os += fmt.Sprintf("%v", out.ID)
  42. // }
  43. // }
  44. // if is == "" && os == "" {
  45. // return ""
  46. // }
  47. // return fmt.Sprintf("S{%s>%s}", is, os)
  48. // }
  49. // func formatValueIO(node *dag.Node) string {
  50. // is := ""
  51. // for i, in := range node.InputValues {
  52. // if i > 0 {
  53. // is += ","
  54. // }
  55. // if in == nil {
  56. // is += "."
  57. // } else {
  58. // is += fmt.Sprintf("%v", in.ID)
  59. // }
  60. // }
  61. // os := ""
  62. // for i, out := range node.OutputValues {
  63. // if i > 0 {
  64. // os += ","
  65. // }
  66. // if out == nil {
  67. // os += "."
  68. // } else {
  69. // os += fmt.Sprintf("%v", out.ID)
  70. // }
  71. // }
  72. // if is == "" && os == "" {
  73. // return ""
  74. // }
  75. // return fmt.Sprintf("V{%s>%s}", is, os)
  76. // }

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