diff options
author | Jakob Borg <jakob@nym.se> | 2014-06-07 04:00:46 +0200 |
---|---|---|
committer | Jakob Borg <jakob@nym.se> | 2014-06-07 04:00:46 +0200 |
commit | df381fd03fb8b399c66b22133c2fe1647a1edc03 (patch) | |
tree | b20798236215558211929e2b99ee0cf7d6181e04 /config | |
parent | 5a2328d9a5f6aca1ff3609c61788d7357d81df83 (diff) |
Let server side decide if restart is needed on config change
Diffstat (limited to 'config')
-rw-r--r-- | config/config.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/config/config.go b/config/config.go index 865bf5c54e..2c8b755513 100644 --- a/config/config.go +++ b/config/config.go @@ -126,6 +126,22 @@ type GUIConfiguration struct { APIKey string `xml:"apikey,omitempty"` } +func (cfg *Configuration) NodeMap() map[string]NodeConfiguration { + m := make(map[string]NodeConfiguration, len(cfg.Nodes)) + for _, n := range cfg.Nodes { + m[n.NodeID] = n + } + return m +} + +func (cfg *Configuration) RepoMap() map[string]RepositoryConfiguration { + m := make(map[string]RepositoryConfiguration, len(cfg.Repositories)) + for _, r := range cfg.Repositories { + m[r.ID] = r + } + return m +} + func setDefaults(data interface{}) error { s := reflect.ValueOf(data).Elem() t := s.Type() |