summaryrefslogtreecommitdiff
path: root/src/state.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/state.go')
-rw-r--r--src/state.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/state.go b/src/state.go
index 6f06860..ba485b2 100644
--- a/src/state.go
+++ b/src/state.go
@@ -7,13 +7,23 @@ type VPNState struct {
// The chosen server
Server *Server `json:"server"`
+
+ // The list of servers and organizations from disco
+ DiscoList *DiscoList `json:"disco"`
}
func Register(state *VPNState, name string, directory string, stateCallback func(string, string, string)) error {
state.Name = name
state.ConfigDirectory = directory
- stateCallback("START", "REGISTERED", "test data")
+ stateCallback("START", "REGISTERED", "app registered")
+
+ // Try to load the previous configuration
+
+ if state.LoadConfig() != nil {
+ // This error can be safely ignored, as when the config does not load, the struct will not be filled
+ // Make sure to log this when we have implemented a good logging system
+ }
return nil
}