-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
state: Interpret basic state through an explicit structure
In order to ease the interpretation of the state yaml data, use a type structure that represents the basic root items of state: - interfaces - routes: - config - running In order to keep the generic nature of these items content, they use as value a generic Go interface{}. The filter helper functions, with this change, have been also made immutable. They now return the filtered values. Signed-off-by: Edward Haas <[email protected]>
- Loading branch information
Showing
2 changed files
with
23 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package state | ||
|
||
type rootState struct { | ||
Interfaces []interface{} `json:"interfaces"` | ||
Routes *routesState `json:"routes,omitempty"` | ||
} | ||
|
||
type routesState struct { | ||
Config []interface{} `json:"config"` | ||
Running []interface{} `json:"running"` | ||
} |