Serge Bazanski | a758ef5 | 2018-10-06 17:54:25 +0100 | [diff] [blame^] | 1 | package state |
2 | |||||
3 | import ( | ||||
4 | pb "code.hackerspace.pl/q3k/topo/proto/control" | ||||
5 | ) | ||||
6 | |||||
7 | type SwitchportState struct { | ||||
8 | Proto *pb.SwitchPort | ||||
9 | } | ||||
10 | |||||
11 | type SwitchState struct { | ||||
12 | Name string | ||||
13 | Ports []*SwitchportState | ||||
14 | } | ||||
15 | |||||
16 | type StateManager struct { | ||||
17 | Switches map[string]*SwitchState | ||||
18 | } | ||||
19 | |||||
20 | func NewManager() *StateManager { | ||||
21 | return &StateManager{ | ||||
22 | Switches: make(map[string]*SwitchState), | ||||
23 | } | ||||
24 | } |