Code Review
/
src
/
xds
/
xds-server.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Update Makefile to be smarter with syncthing compilation.
[src/xds/xds-server.git]
/
lib
/
xdsconfig
/
folderconfig.go
diff --git
a/lib/xdsconfig/folderconfig.go
b/lib/xdsconfig/folderconfig.go
index
f22e76f
..
bb2b56f
100644
(file)
--- a/
lib/xdsconfig/folderconfig.go
+++ b/
lib/xdsconfig/folderconfig.go
@@
-29,13
+29,14
@@
type FolderConfig struct {
SyncThingID string `json:"syncThingID"`
BuilderSThgID string `json:"builderSThgID"`
Status string `json:"status"`
SyncThingID string `json:"syncThingID"`
BuilderSThgID string `json:"builderSThgID"`
Status string `json:"status"`
+ DefaultSdk string `json:"defaultSdk"`
- //
Private
fields
- rootPath string
+ //
Not exported
fields
+ RootPath string `json:"-"`
}
// NewFolderConfig creates a new folder object
}
// NewFolderConfig creates a new folder object
-func NewFolderConfig(id, label, rootDir, path string) FolderConfig {
+func NewFolderConfig(id, label, rootDir, path string
, defaultSdk string
) FolderConfig {
return FolderConfig{
ID: id,
Label: label,
return FolderConfig{
ID: id,
Label: label,
@@
-43,7
+44,8
@@
func NewFolderConfig(id, label, rootDir, path string) FolderConfig {
Type: FolderTypeCloudSync,
SyncThingID: "",
Status: FolderStatusDisable,
Type: FolderTypeCloudSync,
SyncThingID: "",
Status: FolderStatusDisable,
- rootPath: rootDir,
+ RootPath: rootDir,
+ DefaultSdk: defaultSdk,
}
}
}
}
@@
-53,30
+55,30
@@
func (c *FolderConfig) GetFullPath(dir string) string {
dir = ""
}
if filepath.IsAbs(dir) {
dir = ""
}
if filepath.IsAbs(dir) {
- return filepath.Join(c.
r
ootPath, dir)
+ return filepath.Join(c.
R
ootPath, dir)
}
}
- return filepath.Join(c.
r
ootPath, c.RelativePath, dir)
+ return filepath.Join(c.
R
ootPath, c.RelativePath, dir)
}
}
-//
Folder
Verify is called to verify that a configuration is valid
-func
FolderVerify(fCfg FolderConfig
) error {
+// Verify is called to verify that a configuration is valid
+func
(c *FolderConfig) Verify(
) error {
var err error
var err error
- if
fCfg
.Type != FolderTypeCloudSync {
+ if
c
.Type != FolderTypeCloudSync {
err = fmt.Errorf("Unsupported folder type")
}
err = fmt.Errorf("Unsupported folder type")
}
- if
fCfg
.SyncThingID == "" {
+ if
c
.SyncThingID == "" {
err = fmt.Errorf("device id not set (SyncThingID field)")
}
err = fmt.Errorf("device id not set (SyncThingID field)")
}
- if
fCfg.r
ootPath == "" {
- err = fmt.Errorf("
r
ootPath must not be empty")
+ if
c.R
ootPath == "" {
+ err = fmt.Errorf("
R
ootPath must not be empty")
}
if err != nil {
}
if err != nil {
-
fCfg
.Status = FolderStatusErrorConfig
- log.Printf("ERROR
Folder
Verify: %v\n", err)
+
c
.Status = FolderStatusErrorConfig
+ log.Printf("ERROR Verify: %v\n", err)
}
return err
}
return err