diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-11-29 11:19:00 +0100 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-11-29 15:17:45 +0100 |
commit | 7c7d90a781082c6bd22d12a5e2451ca61a5198af (patch) | |
tree | 980c4ebea211b1a757343296debc39b3aa6b4859 /lib/agent/project-pathmap.go | |
parent | b9239d295a7fb7e3f5c595887b3bf77d50c8b216 (diff) |
Renamed apiv1 lib to xaapiv1.
xa prefix (for Xds Agent) is safest to avoid confusion with xs prefix (for Xds Server)
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'lib/agent/project-pathmap.go')
-rw-r--r-- | lib/agent/project-pathmap.go | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/agent/project-pathmap.go b/lib/agent/project-pathmap.go index 3c87770..1880fa3 100644 --- a/lib/agent/project-pathmap.go +++ b/lib/agent/project-pathmap.go @@ -6,8 +6,9 @@ import ( "os" "strings" - "github.com/iotbzh/xds-agent/lib/apiv1" + "github.com/iotbzh/xds-agent/lib/xaapiv1" common "github.com/iotbzh/xds-common/golib" + "github.com/iotbzh/xds-server/lib/xsapiv1" ) // IPROJECT interface implementation for native/path mapping projects @@ -16,7 +17,7 @@ import ( type PathMap struct { *Context server *XdsServer - folder *XdsFolderConfig + folder *xsapiv1.FolderConfig } // NewProjectPathMap Create a new instance of PathMap @@ -24,13 +25,13 @@ func NewProjectPathMap(ctx *Context, svr *XdsServer) *PathMap { p := PathMap{ Context: ctx, server: svr, - folder: &XdsFolderConfig{}, + folder: &xsapiv1.FolderConfig{}, } return &p } // Add a new project -func (p *PathMap) Add(cfg apiv1.ProjectConfig) (*apiv1.ProjectConfig, error) { +func (p *PathMap) Add(cfg xaapiv1.ProjectConfig) (*xaapiv1.ProjectConfig, error) { var err error var file *os.File errMsg := "ClientPath sanity check error (%d): %v" @@ -92,24 +93,24 @@ func (p *PathMap) Delete() error { } // GetProject Get public part of project config -func (p *PathMap) GetProject() *apiv1.ProjectConfig { +func (p *PathMap) GetProject() *xaapiv1.ProjectConfig { prj := p.server.FolderToProject(*p.folder) prj.ServerID = p.server.ID return &prj } // Setup Setup local project config -func (p *PathMap) Setup(prj apiv1.ProjectConfig) (*apiv1.ProjectConfig, error) { +func (p *PathMap) Setup(prj xaapiv1.ProjectConfig) (*xaapiv1.ProjectConfig, error) { p.folder = p.server.ProjectToFolder(prj) np := p.GetProject() - if err := p.events.Emit(apiv1.EVTProjectChange, np, ""); err != nil { + if err := p.events.Emit(xaapiv1.EVTProjectChange, np, ""); err != nil { return np, err } return np, nil } // Update Update some field of a project -func (p *PathMap) Update(prj apiv1.ProjectConfig) (*apiv1.ProjectConfig, error) { +func (p *PathMap) Update(prj xaapiv1.ProjectConfig) (*xaapiv1.ProjectConfig, error) { if p.folder.ID != prj.ID { return nil, fmt.Errorf("Invalid id") } |