summaryrefslogtreecommitdiffstats
path: root/lib/agent/project-pathmap.go
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-10-31 18:09:45 +0100
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-11-06 10:18:00 +0100
commitbe13167b869161b6e19dc3e94835245cdc7911e5 (patch)
treec22fef52671c7e9a3f724acb02b8a62d64b3f94a /lib/agent/project-pathmap.go
parent459f46bc410c8641314d5f3eb39c871558b7d156 (diff)
Moved all structs exposed by API into apiv1 package
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'lib/agent/project-pathmap.go')
-rw-r--r--lib/agent/project-pathmap.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/agent/project-pathmap.go b/lib/agent/project-pathmap.go
index aacbd1f..7a96e6e 100644
--- a/lib/agent/project-pathmap.go
+++ b/lib/agent/project-pathmap.go
@@ -6,6 +6,7 @@ import (
"os"
"strings"
+ "github.com/iotbzh/xds-agent/lib/apiv1"
common "github.com/iotbzh/xds-common/golib"
)
@@ -29,7 +30,7 @@ func NewProjectPathMap(ctx *Context, svr *XdsServer) *PathMap {
}
// Add a new project
-func (p *PathMap) Add(cfg ProjectConfig) (*ProjectConfig, error) {
+func (p *PathMap) Add(cfg apiv1.ProjectConfig) (*apiv1.ProjectConfig, error) {
var err error
var file *os.File
errMsg := "ClientPath sanity check error (%d): %v"
@@ -91,17 +92,17 @@ func (p *PathMap) Delete() error {
}
// GetProject Get public part of project config
-func (p *PathMap) GetProject() *ProjectConfig {
+func (p *PathMap) GetProject() *apiv1.ProjectConfig {
prj := p.server.FolderToProject(*p.folder)
prj.ServerID = p.server.ID
return &prj
}
// UpdateProject Set project config
-func (p *PathMap) UpdateProject(prj ProjectConfig) (*ProjectConfig, error) {
+func (p *PathMap) UpdateProject(prj apiv1.ProjectConfig) (*apiv1.ProjectConfig, error) {
p.folder = p.server.ProjectToFolder(prj)
np := p.GetProject()
- if err := p.events.Emit(EVTProjectChange, np); err != nil {
+ if err := p.events.Emit(apiv1.EVTProjectChange, np); err != nil {
return np, err
}
return np, nil