paramters in node

This commit is contained in:
Niko Kivel
2021-05-08 19:04:37 +02:00
parent 37556e6a64
commit dd4c075f50
6 changed files with 51 additions and 0 deletions

View File

@@ -36,6 +36,7 @@ type NodeConf struct {
Discoverable bool `yaml:"discoverable,omitempty"`
Profiles []string `yaml:"profiles,omitempty"`
NetDevs map[string]*NetDevs `yaml:"network devices,omitempty"`
Params map[string]*Params `yaml:"parameters,omitempty"`
}
type NetDevs struct {
@@ -47,6 +48,10 @@ type NetDevs struct {
Gateway string `yaml:"gateway,omitempty"`
}
type Params struct {
Value string `yaml:"value,omitempty"`
}
/******
* Internal code data representations
******/
@@ -82,6 +87,7 @@ type NodeInfo struct {
Profiles []string
GroupProfiles []string
NetDevs map[string]*NetDevEntry
Params map[string]*ParamEntry
}
type NetDevEntry struct {
@@ -93,6 +99,10 @@ type NetDevEntry struct {
Gateway Entry `yaml:"gateway,omitempty"`
}
type ParamEntry struct {
Value Entry `yaml:"value,omitempty"`
}
func init() {
//TODO: Check to make sure nodes.conf is found
if !util.IsFile(ConfigFile) {