diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-03-22 14:42:20 +0100 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-03-22 14:42:20 +0100 |
| commit | 22f9d7bafc60f56259e74df98e544b5820cfca5b (patch) | |
| tree | fdc4886d035d04623666cb3132f3054bda77e889 /src/state.go | |
| parent | eb5a1f2e9d47530c1896f49a2c4e7ffc82bcce4f (diff) | |
Save a local copy of the disco list
Diffstat (limited to 'src/state.go')
| -rw-r--r-- | src/state.go | 12 |
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 } |
