aboutsummaryrefslogtreecommitdiffstats
path: root/lib/syncthing/folder-st.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/syncthing/folder-st.go')
-rw-r--r--lib/syncthing/folder-st.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/syncthing/folder-st.go b/lib/syncthing/folder-st.go
index f25a505..74aa4bb 100644
--- a/lib/syncthing/folder-st.go
+++ b/lib/syncthing/folder-st.go
@@ -143,6 +143,15 @@ func (f *STFolder) Remove() error {
return err2
}
+// Update update some fields of a folder
+func (f *STFolder) Update(cfg folder.FolderConfig) (*folder.FolderConfig, error) {
+ if f.fConfig.ID != cfg.ID {
+ return nil, fmt.Errorf("Invalid id")
+ }
+ f.fConfig = cfg
+ return &f.fConfig, nil
+}
+
// RegisterEventChange requests registration for folder event change
func (f *STFolder) RegisterEventChange(cb *folder.EventCB, data *folder.EventCBData) error {
f.eventChangeCB = cb