|
1 | 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
2 | 2 |
|
3 | | -package topology |
| 3 | +package l2topology |
4 | 4 |
|
5 | 5 | import "time" |
6 | 6 |
|
@@ -54,88 +54,6 @@ type Link struct { |
54 | 54 | Metrics map[string]any `json:"metrics,omitempty"` |
55 | 55 | } |
56 | 56 |
|
57 | | -// Presentation defines how the UI should render this topology. |
58 | | -// Sent in the info response, not in data responses. |
59 | | - |
60 | | -type PresentationSummaryField struct { |
61 | | - Key string `json:"key"` |
62 | | - Label string `json:"label"` |
63 | | - Sources []string `json:"sources"` |
64 | | -} |
65 | | - |
66 | | -type PresentationTableColumn struct { |
67 | | - Key string `json:"key"` |
68 | | - Label string `json:"label"` |
69 | | - Type string `json:"type,omitempty"` |
70 | | -} |
71 | | - |
72 | | -type PresentationTable struct { |
73 | | - Label string `json:"label"` |
74 | | - Source string `json:"source"` |
75 | | - BulletSource bool `json:"bullet_source,omitempty"` |
76 | | - Order int `json:"order,omitempty"` |
77 | | - Columns []PresentationTableColumn `json:"columns"` |
78 | | -} |
79 | | - |
80 | | -type PresentationModalTab struct { |
81 | | - ID string `json:"id"` |
82 | | - Label string `json:"label"` |
83 | | - Type string `json:"type,omitempty"` |
84 | | -} |
85 | | - |
86 | | -type PresentationActorType struct { |
87 | | - Label string `json:"label"` |
88 | | - ColorSlot string `json:"color_slot"` |
89 | | - Opacity float64 `json:"opacity,omitempty"` |
90 | | - Border bool `json:"border"` |
91 | | - Role string `json:"role,omitempty"` |
92 | | - SizeByLinks bool `json:"size_by_links,omitempty"` |
93 | | - ShowPortBullets bool `json:"show_port_bullets,omitempty"` |
94 | | - IconSVG string `json:"icon_svg,omitempty"` |
95 | | - SummaryFields []PresentationSummaryField `json:"summary_fields"` |
96 | | - Tables map[string]PresentationTable `json:"tables"` |
97 | | - ModalTabs []PresentationModalTab `json:"modal_tabs"` |
98 | | -} |
99 | | - |
100 | | -type PresentationLinkType struct { |
101 | | - Label string `json:"label"` |
102 | | - ColorSlot string `json:"color_slot"` |
103 | | - Opacity float64 `json:"opacity,omitempty"` |
104 | | - Width float64 `json:"width,omitempty"` |
105 | | - Dash bool `json:"dash,omitempty"` |
106 | | -} |
107 | | - |
108 | | -type PresentationPortType struct { |
109 | | - Label string `json:"label"` |
110 | | - ColorSlot string `json:"color_slot"` |
111 | | - Opacity float64 `json:"opacity,omitempty"` |
112 | | -} |
113 | | - |
114 | | -type PresentationPortField struct { |
115 | | - Key string `json:"key"` |
116 | | - Label string `json:"label"` |
117 | | -} |
118 | | - |
119 | | -type PresentationLegendEntry struct { |
120 | | - Type string `json:"type"` |
121 | | - Label string `json:"label"` |
122 | | -} |
123 | | - |
124 | | -type PresentationLegend struct { |
125 | | - Actors []PresentationLegendEntry `json:"actors"` |
126 | | - Links []PresentationLegendEntry `json:"links"` |
127 | | - Ports []PresentationLegendEntry `json:"ports,omitempty"` |
128 | | -} |
129 | | - |
130 | | -type Presentation struct { |
131 | | - ActorTypes map[string]PresentationActorType `json:"actor_types"` |
132 | | - LinkTypes map[string]PresentationLinkType `json:"link_types"` |
133 | | - PortTypes map[string]PresentationPortType `json:"port_types,omitempty"` |
134 | | - PortFields []PresentationPortField `json:"port_fields,omitempty"` |
135 | | - Legend PresentationLegend `json:"legend"` |
136 | | - ActorClickBehavior string `json:"actor_click_behavior"` |
137 | | -} |
138 | | - |
139 | 57 | type FlowExporter struct { |
140 | 58 | IP string `json:"ip,omitempty"` |
141 | 59 | Name string `json:"name,omitempty"` |
@@ -164,7 +82,7 @@ type IPPolicy struct { |
164 | 82 | LiveTopN *LiveTopN `json:"live_top_n,omitempty"` |
165 | 83 | } |
166 | 84 |
|
167 | | -type Data struct { |
| 85 | +type Graph struct { |
168 | 86 | SchemaVersion string `json:"schema_version"` |
169 | 87 | Source string `json:"source,omitempty"` |
170 | 88 | Layer string `json:"layer,omitempty"` |
|
0 commit comments