diff options
Diffstat (limited to 'src/dkv/api/configHandlers.go')
-rw-r--r-- | src/dkv/api/configHandlers.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/dkv/api/configHandlers.go b/src/dkv/api/configHandlers.go index f5bac34..7178433 100644 --- a/src/dkv/api/configHandlers.go +++ b/src/dkv/api/configHandlers.go @@ -81,6 +81,8 @@ func HandleConfigUpload(w http.ResponseWriter, r *http.Request) { } defer f.Close() io.Copy(f, file) + + GenerateResponse(w, r, http.StatusOK, "Configuration uploaded to Token: "+token) } func HandleConfigLoad(w http.ResponseWriter, r *http.Request) { @@ -102,14 +104,14 @@ func HandleConfigLoad(w http.ResponseWriter, r *http.Request) { return } - err = KeyValues.ConfigReader(body.Token, body.Subdomain, body.Filename) + kvs_map, err := KeyValues.ConfigReader(body.Token, body.Subdomain, body.Filename) if err != nil { GenerateResponse(w, r, http.StatusInternalServerError, string(err.Error())) return } - err = KeyValues.WriteKVsToConsul(body.Token, body.Subdomain) + err = KeyValues.WriteKVsToConsul(body.Token, body.Subdomain, kvs_map) if err != nil { GenerateResponse(w, r, http.StatusInternalServerError, string(err.Error())) @@ -119,12 +121,12 @@ func HandleConfigLoad(w http.ResponseWriter, r *http.Request) { } func HandleDefaultConfigLoad(w http.ResponseWriter, r *http.Request) { - err := KeyValues.ConfigReader("default", "", "") + kvs_map, err := KeyValues.ConfigReader("default", "", "") if err != nil { GenerateResponse(w, r, http.StatusInternalServerError, string(err.Error())) return } - err = KeyValues.WriteKVsToConsul("default", "") + err = KeyValues.WriteKVsToConsul("default", "", kvs_map) if err != nil { GenerateResponse(w, r, http.StatusInternalServerError, string(err.Error())) } else { |