3 // FolderType definition
7 TypePathMap = "PathMap"
8 TypeCloudSync = "CloudSync"
12 // Folder Status definition
14 StatusErrorConfig = "ErrorConfig"
15 StatusDisable = "Disable"
16 StatusEnable = "Enable"
18 StatusSyncing = "Syncing"
21 // FolderConfig is the config for one folder
22 type FolderConfig struct {
24 Label string `json:"label"`
25 ClientPath string `json:"path"`
26 Type FolderType `json:"type"`
27 Status string `json:"status"`
28 IsInSync bool `json:"isInSync"`
29 DefaultSdk string `json:"defaultSdk"`
30 ClientData string `json:"clientData"` // free form field that can used by client
32 // Not exported fields from REST API point of view
33 RootPath string `json:"-"`
35 // FIXME: better to define an equivalent to union data and then implement
36 // UnmarshalJSON/MarshalJSON to decode/encode according to Type value
37 // Data interface{} `json:"data"`
39 // Specific data depending on which Type is used
40 DataPathMap PathMapConfig `json:"dataPathMap,omitempty"`
41 DataCloudSync CloudSyncConfig `json:"dataCloudSync,omitempty"`
44 // FolderConfigUpdatableFields List fields that can be updated using Update function
45 var FolderConfigUpdatableFields = []string{
46 "Label", "DefaultSdk", "ClientData",
49 // PathMapConfig Path mapping specific data
50 type PathMapConfig struct {
51 ServerPath string `json:"serverPath"`
53 // Don't keep temporary file name (IOW we don't want to save it and reuse it)
54 CheckFile string `json:"checkFile" xml:"-"`
55 CheckContent string `json:"checkContent" xml:"-"`
58 // CloudSyncConfig CloudSync (AKA Syncthing) specific data
59 type CloudSyncConfig struct {
60 SyncThingID string `json:"syncThingID"`
62 // Not exported fields (only used internally)
63 STSvrStatus string `json:"-"`
64 STSvrIsInSync bool `json:"-"`
65 STLocStatus string `json:"-"`
66 STLocIsInSync bool `json:"-"`