aboutsummaryrefslogtreecommitdiffstats
path: root/lib/agent/xdsserver.go
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-10-16 18:17:44 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-10-16 18:17:44 +0200
commit77ab312b87324090ec6cb619d11f792b53fdddbd (patch)
tree194cb312f831eabf9a5f1cd93fa7f5c13274fa50 /lib/agent/xdsserver.go
parent4695555e178bcabe54c5bf82117c9c4cef5440b5 (diff)
Add sanity check when adding a new pathmap project/folder
Diffstat (limited to 'lib/agent/xdsserver.go')
-rw-r--r--lib/agent/xdsserver.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/agent/xdsserver.go b/lib/agent/xdsserver.go
index c900c9e..b76908c 100644
--- a/lib/agent/xdsserver.go
+++ b/lib/agent/xdsserver.go
@@ -84,7 +84,9 @@ type XdsFolderConfig struct {
// XdsPathMapConfig Path mapping specific data
type XdsPathMapConfig struct {
- ServerPath string `json:"serverPath"`
+ ServerPath string `json:"serverPath"`
+ CheckFile string `json:"checkFile"`
+ CheckContent string `json:"checkContent"`
}
// XdsCloudSyncConfig CloudSync (AKA Syncthing) specific data
@@ -205,13 +207,13 @@ func (xs *XdsServer) GetVersion(res interface{}) error {
}
// GetFolders Send GET request to get current folder configuration
-func (xs *XdsServer) GetFolders(prjs *[]XdsFolderConfig) error {
- return xs._HTTPGet("/folders", prjs)
+func (xs *XdsServer) GetFolders(folders *[]XdsFolderConfig) error {
+ return xs._HTTPGet("/folders", folders)
}
// FolderAdd Send POST request to add a folder
-func (xs *XdsServer) FolderAdd(prj *XdsFolderConfig, res interface{}) error {
- response, err := xs._HTTPPost("/folder", prj)
+func (xs *XdsServer) FolderAdd(fld *XdsFolderConfig, res interface{}) error {
+ response, err := xs._HTTPPost("/folder", fld)
if err != nil {
return err
}