3 // ProjectType definition
4 type ProjectType string
7 TypePathMap = "PathMap"
8 TypeCloudSync = "CloudSync"
12 // Project Status definition
14 StatusErrorConfig = "ErrorConfig"
15 StatusDisable = "Disable"
16 StatusEnable = "Enable"
18 StatusSyncing = "Syncing"
21 type EventCBData map[string]interface{}
22 type EventCB func(cfg *ProjectConfig, data *EventCBData)
24 // IPROJECT Project interface
25 type IPROJECT interface {
26 Add(cfg ProjectConfig) (*ProjectConfig, error) // Add a new project
27 Delete() error // Delete a project
28 GetProject() *ProjectConfig // Get project public configuration
29 SetProject(prj ProjectConfig) *ProjectConfig // Set project configuration
30 GetServer() *XdsServer // Get XdsServer that holds this project
31 GetFullPath(dir string) string // Get project full path
32 Sync() error // Force project files synchronization
33 IsInSync() (bool, error) // Check if project files are in-sync
36 // ProjectConfig is the config for one project
37 type ProjectConfig struct {
39 ServerID string `json:"serverId"`
40 Label string `json:"label"`
41 ClientPath string `json:"clientPath"`
42 ServerPath string `json:"serverPath"`
43 Type ProjectType `json:"type"`
44 Status string `json:"status"`
45 IsInSync bool `json:"isInSync"`
46 DefaultSdk string `json:"defaultSdk"`