aboutsummaryrefslogtreecommitdiffstats
path: root/lib/xdsserver/folder-interface.go
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-11-29 08:54:00 +0100
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-11-29 11:10:30 +0100
commit2f7828d01f4c4ca2909f95f098627cd5475ed225 (patch)
treeb5e71920b813b95cae3e32044be08b99223348ec /lib/xdsserver/folder-interface.go
parent5caebfb4b7c3b73988f067082b219ce5b7f409ba (diff)
Refit source files to have a public xs-apiv1 lib package.
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'lib/xdsserver/folder-interface.go')
-rw-r--r--lib/xdsserver/folder-interface.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/xdsserver/folder-interface.go b/lib/xdsserver/folder-interface.go
new file mode 100644
index 0000000..c2b2ada
--- /dev/null
+++ b/lib/xdsserver/folder-interface.go
@@ -0,0 +1,22 @@
+package xdsserver
+
+import "github.com/iotbzh/xds-server/lib/xsapiv1"
+
+type FolderEventCBData map[string]interface{}
+type FolderEventCB func(cfg *xsapiv1.FolderConfig, data *FolderEventCBData)
+
+// IFOLDER Folder interface
+type IFOLDER interface {
+ NewUID(suffix string) string // Get a new folder UUID
+ Add(cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error) // Add a new folder
+ GetConfig() xsapiv1.FolderConfig // Get folder public configuration
+ GetFullPath(dir string) string // Get folder full path
+ ConvPathCli2Svr(s string) string // Convert path from Client to Server
+ ConvPathSvr2Cli(s string) string // Convert path from Server to Client
+ Remove() error // Remove a folder
+ Update(cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error) // Update a new folder
+ RegisterEventChange(cb *FolderEventCB, data *FolderEventCBData) error // Request events registration (sent through WS)
+ UnRegisterEventChange() error // Un-register events
+ Sync() error // Force folder files synchronization
+ IsInSync() (bool, error) // Check if folder files are in-sync
+}