summaryrefslogtreecommitdiffstats
path: root/lib/xdsserver/folder-st-disable.go
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-12-16 00:10:14 +0100
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-12-16 00:10:14 +0100
commit285332c351777b74abca638b8b2a2cde3c68edc6 (patch)
treece52d6d347f23a944520a6b239f8099de75e1a41 /lib/xdsserver/folder-st-disable.go
parent963931e04d44a5b40d38817163f52f56241a9f33 (diff)
Fixed and improved events management.
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'lib/xdsserver/folder-st-disable.go')
-rw-r--r--lib/xdsserver/folder-st-disable.go27
1 files changed, 11 insertions, 16 deletions
diff --git a/lib/xdsserver/folder-st-disable.go b/lib/xdsserver/folder-st-disable.go
index 4dbe2a9..c52854d 100644
--- a/lib/xdsserver/folder-st-disable.go
+++ b/lib/xdsserver/folder-st-disable.go
@@ -29,7 +29,7 @@ import (
// STFolderDisable .
type STFolderDisable struct {
*Context
- config xsapiv1.FolderConfig
+ fConfig xsapiv1.FolderConfig
}
// NewFolderSTDisable Create a new instance of STFolderDisable
@@ -51,15 +51,20 @@ func (f *STFolderDisable) NewUID(suffix string) string {
// Add a new folder
func (f *STFolderDisable) Add(cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error) {
- f.config = cfg
- f.config.Status = xsapiv1.StatusDisable
- f.config.IsInSync = false
- return &f.config, nil
+ return f.Setup(cfg)
+}
+
+// Setup Setup local project config
+func (f *STFolderDisable) Setup(cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error) {
+ f.fConfig = cfg
+ f.fConfig.Status = xsapiv1.StatusDisable
+ f.fConfig.IsInSync = false
+ return &f.fConfig, nil
}
// GetConfig Get public part of folder config
func (f *STFolderDisable) GetConfig() xsapiv1.FolderConfig {
- return f.config
+ return f.fConfig
}
// GetFullPath returns the full path of a directory (from server POV)
@@ -87,16 +92,6 @@ func (f *STFolderDisable) Update(cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfi
return nil, nil
}
-// RegisterEventChange requests registration for folder change event
-func (f *STFolderDisable) RegisterEventChange(cb *FolderEventCB, data *FolderEventCBData) error {
- return nil
-}
-
-// UnRegisterEventChange remove registered callback
-func (f *STFolderDisable) UnRegisterEventChange() error {
- return nil
-}
-
// Sync Force folder files synchronization
func (f *STFolderDisable) Sync() error {
return nil