Documentation ¶
Index ¶
- Constants
- type CloudSyncConfig
- type EventCB
- type EventCBData
- type FolderConfig
- type FolderType
- type IFOLDER
- type PathMap
- func (f *PathMap) Add(cfg FolderConfig) (*FolderConfig, error)
- func (f *PathMap) GetConfig() FolderConfig
- func (f *PathMap) GetFullPath(dir string) string
- func (f *PathMap) IsInSync() (bool, error)
- func (f *PathMap) NewUID(suffix string) string
- func (f *PathMap) RegisterEventChange(cb *EventCB, data *EventCBData) error
- func (f *PathMap) Remove() error
- func (f *PathMap) Sync() error
- func (f *PathMap) UnRegisterEventChange() error
- type PathMapConfig
Constants ¶
View Source
const ( TypePathMap = 1 TypeCloudSync = 2 TypeCifsSmb = 3 )
View Source
const ( StatusErrorConfig = "ErrorConfig" StatusDisable = "Disable" StatusEnable = "Enable" StatusPause = "Pause" StatusSyncing = "Syncing" )
Folder Status definition
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloudSyncConfig ¶
type CloudSyncConfig struct { SyncThingID string `json:"syncThingID"` BuilderSThgID string `json:"builderSThgID"` }
CloudSyncConfig CloudSync (AKA Syncthing) specific data
type EventCB ¶
type EventCB func(cfg *FolderConfig, data *EventCBData)
type EventCBData ¶
type EventCBData map[string]interface{}
type FolderConfig ¶
type FolderConfig struct { ID string `json:"id"` Label string `json:"label"` ClientPath string `json:"path"` Type FolderType `json:"type"` Status string `json:"status"` IsInSync bool `json:"isInSync"` DefaultSdk string `json:"defaultSdk"` // Not exported fields from REST API point of view RootPath string `json:"-"` // Specific data depending on which Type is used DataPathMap PathMapConfig `json:"dataPathMap,omitempty"` DataCloudSync CloudSyncConfig `json:"dataCloudSync,omitempty"` }
FolderConfig is the config for one folder
type IFOLDER ¶
type IFOLDER interface { NewUID(suffix string) string // Get a new folder UUID Add(cfg FolderConfig) (*FolderConfig, error) // Add a new folder GetConfig() FolderConfig // Get folder public configuration GetFullPath(dir string) string // Get folder full path Remove() error // Remove a folder RegisterEventChange(cb *EventCB, data *EventCBData) 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 }
IFOLDER Folder interface
type PathMap ¶
type PathMap struct {
// contains filtered or unexported fields
}
PathMap .
func NewFolderPathMap ¶
NewFolderPathMap Create a new instance of PathMap
func (*PathMap) Add ¶
func (f *PathMap) Add(cfg FolderConfig) (*FolderConfig, error)
Add a new folder
func (*PathMap) GetConfig ¶
func (f *PathMap) GetConfig() FolderConfig
GetConfig Get public part of folder config
func (*PathMap) GetFullPath ¶
GetFullPath returns the full path
func (*PathMap) RegisterEventChange ¶
func (f *PathMap) RegisterEventChange(cb *EventCB, data *EventCBData) error
RegisterEventChange requests registration for folder change event
func (*PathMap) UnRegisterEventChange ¶
UnRegisterEventChange remove registered callback
type PathMapConfig ¶
type PathMapConfig struct {
ServerPath string `json:"serverPath"`
}
PathMapConfig Path mapping specific data
Click to show internal directories.
Click to hide internal directories.