summaryrefslogtreecommitdiffstats
path: root/lib/xdsserver/folder-interface.go
blob: c2b2adaf3bd6f50c7af9f0ce16739e0ae441a059 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
}