scope_summary.go 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package render
  2. import (
  3. "go-admin/render/report"
  4. )
  5. // NodeSummaryGroup is a topology-typed group of children for a Node.
  6. type NodeSummaryGroup struct {
  7. ID string `json:"id"`
  8. Label string `json:"label"`
  9. Nodes []NodeSummary `json:"nodes"`
  10. TopologyID string `json:"topologyId"`
  11. Columns []Column `json:"columns"`
  12. }
  13. // Column provides special json serialization for column ids, so they include
  14. // their label for the frontend.
  15. type Column struct {
  16. ID string `json:"id"`
  17. Label string `json:"label"`
  18. DefaultSort bool `json:"defaultSort"`
  19. Datatype string `json:"dataType"`
  20. }
  21. // BasicNodeSummary is basic summary information about a Node,
  22. // sufficient for rendering links to the node.
  23. type BasicNodeSummary struct {
  24. ID string `json:"id"`
  25. Label string `json:"label"`
  26. LabelMinor string `json:"labelMinor"`
  27. Rank string `json:"rank"`
  28. Shape string `json:"shape,omitempty"`
  29. Color string `json:"color,omitempty"`
  30. Tag string `json:"tag,omitempty"`
  31. Stack bool `json:"stack,omitempty"`
  32. Pseudo bool `json:"pseudo,omitempty"`
  33. }
  34. // Parent is the information needed to build a link to the parent of a Node.
  35. type Parent struct {
  36. ID string `json:"id"`
  37. Label string `json:"label"`
  38. TopologyID string `json:"topologyId"`
  39. }
  40. // NodeSummary is summary information about a Node.
  41. type NodeSummary struct {
  42. BasicNodeSummary
  43. Metadata []report.MetadataRow `json:"metadata,omitempty"`
  44. Parents []Parent `json:"parents,omitempty"`
  45. Metrics []report.MetricRow `json:"metrics,omitempty"`
  46. Tables []report.Table `json:"tables,omitempty"`
  47. Adjacency report.IDList `json:"adjacency,omitempty"`
  48. }