From 815e1f48dcd3ed9407e41e4690a91de8c7082b8f Mon Sep 17 00:00:00 2001 From: mr Date: Thu, 1 Aug 2024 09:27:38 +0200 Subject: [PATCH] controllers with new search --- Dockerfile | 2 -- controllers/data.go | 2 +- controllers/datacenter.go | 2 +- controllers/processing.go | 2 +- controllers/resource.go | 2 +- controllers/storage.go | 2 +- controllers/workflow.go | 2 +- go.mod | 2 +- go.sum | 4 ++++ 9 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 81bb020..027403c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,8 +8,6 @@ RUN apk add git RUN go get github.com/beego/bee/v2 && go install github.com/beego/bee/v2@master -RUN go get cloud.o-forge.io/core/oc-lib - RUN timeout 15 bee run -gendoc=true -downdoc=true -runmode=dev || : RUN sed -i 's/http:\/\/127.0.0.1:8080\/swagger\/swagger.json/swagger.json/g' swagger/index.html diff --git a/controllers/data.go b/controllers/data.go index 5706536..ada0bea 100644 --- a/controllers/data.go +++ b/controllers/data.go @@ -55,7 +55,7 @@ func (o *DataController) GetAll() { // @router /search/:search [get] func (o *DataController) Search() { search := o.Ctx.Input.Param(":search") - o.Data["json"] = oclib.Search(search, oclib.LibDataEnum(oclib.DATA_RESOURCE)) + o.Data["json"] = oclib.Search(nil, search, oclib.LibDataEnum(oclib.DATA_RESOURCE)) o.ServeJSON() } diff --git a/controllers/datacenter.go b/controllers/datacenter.go index 715846e..8fee8a6 100644 --- a/controllers/datacenter.go +++ b/controllers/datacenter.go @@ -55,7 +55,7 @@ func (o *DatacenterController) GetAll() { // @router /search/:search [get] func (o *DatacenterController) Search() { search := o.Ctx.Input.Param(":search") - o.Data["json"] = oclib.Search(search, oclib.LibDataEnum(oclib.DATACENTER_RESOURCE)) + o.Data["json"] = oclib.Search(nil, search, oclib.LibDataEnum(oclib.DATACENTER_RESOURCE)) o.ServeJSON() } diff --git a/controllers/processing.go b/controllers/processing.go index 4c34a8d..0c49dff 100644 --- a/controllers/processing.go +++ b/controllers/processing.go @@ -55,7 +55,7 @@ func (o *ProcessingController) GetAll() { // @router /search/:search [get] func (o *ProcessingController) Search() { search := o.Ctx.Input.Param(":search") - o.Data["json"] = oclib.Search(search, oclib.LibDataEnum(oclib.PROCESSING_RESOURCE)) + o.Data["json"] = oclib.Search(nil, search, oclib.LibDataEnum(oclib.PROCESSING_RESOURCE)) o.ServeJSON() } diff --git a/controllers/resource.go b/controllers/resource.go index c2a417b..0776f95 100644 --- a/controllers/resource.go +++ b/controllers/resource.go @@ -37,7 +37,7 @@ func (o *ResourceController) Search() { search := o.Ctx.Input.Param(":search") results := map[string]interface{}{} for _, resource := range []oclib.LibDataEnum{oclib.LibDataEnum(oclib.DATACENTER_RESOURCE), oclib.LibDataEnum(oclib.DATACENTER_RESOURCE), oclib.LibDataEnum(oclib.STORAGE_RESOURCE), oclib.LibDataEnum(oclib.PROCESSING_RESOURCE), oclib.LibDataEnum(oclib.WORKFLOW_RESOURCE)} { - d := oclib.Search(search, resource) + d := oclib.Search(nil, search, resource) if d.Code != 200 || len(d.Data) == 0 { results[resource.String()] = []interface{}{} } else { diff --git a/controllers/storage.go b/controllers/storage.go index a9c62d7..5aaec4d 100644 --- a/controllers/storage.go +++ b/controllers/storage.go @@ -34,7 +34,7 @@ func (o *StorageController) Put() { // @router /search/:search [get] func (o *StorageController) Search() { search := o.Ctx.Input.Param(":search") - o.Data["json"] = oclib.Search(search, oclib.LibDataEnum(oclib.STORAGE_RESOURCE)) + o.Data["json"] = oclib.Search(nil, search, oclib.LibDataEnum(oclib.STORAGE_RESOURCE)) o.ServeJSON() } diff --git a/controllers/workflow.go b/controllers/workflow.go index 1e08229..1f213a3 100644 --- a/controllers/workflow.go +++ b/controllers/workflow.go @@ -34,7 +34,7 @@ func (o *WorkflowController) Put() { // @router /search/:search [get] func (o *WorkflowController) Search() { search := o.Ctx.Input.Param(":search") - o.Data["json"] = oclib.Search(search, oclib.LibDataEnum(oclib.WORKFLOW_RESOURCE)) + o.Data["json"] = oclib.Search(nil, search, oclib.LibDataEnum(oclib.WORKFLOW_RESOURCE)) o.ServeJSON() } diff --git a/go.mod b/go.mod index 27ed4ef..e289a48 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( ) require ( - cloud.o-forge.io/core/oc-lib v0.0.0-20240731123052-78bef28a2171 // indirect + cloud.o-forge.io/core/oc-lib v0.0.0-20240801071310-924a688a9d3f // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/beego/bee/v2 v2.1.0 // indirect github.com/beorn7/perks v1.0.1 // indirect diff --git a/go.sum b/go.sum index e91ac15..d52e9ec 100644 --- a/go.sum +++ b/go.sum @@ -122,6 +122,10 @@ cloud.o-forge.io/core/oc-lib v0.0.0-20240730124133-b06193add2fe h1:dAA8GotTauJxV cloud.o-forge.io/core/oc-lib v0.0.0-20240730124133-b06193add2fe/go.mod h1:V5EL+NV2s9P1/BcFm3/icfLeBYVVMLl1Z0F0eecJZGo= cloud.o-forge.io/core/oc-lib v0.0.0-20240731123052-78bef28a2171 h1:SiTy74sfSeO97umBOnUZNrBl613LM0oqBw8eOOsYv7I= cloud.o-forge.io/core/oc-lib v0.0.0-20240731123052-78bef28a2171/go.mod h1:V5EL+NV2s9P1/BcFm3/icfLeBYVVMLl1Z0F0eecJZGo= +cloud.o-forge.io/core/oc-lib v0.0.0-20240731145630-ad455e0e3a91 h1:o7hnTWo9VpoYV/+l/+ET8jVF4olagDMpVQ2w19Wp6z0= +cloud.o-forge.io/core/oc-lib v0.0.0-20240731145630-ad455e0e3a91/go.mod h1:V5EL+NV2s9P1/BcFm3/icfLeBYVVMLl1Z0F0eecJZGo= +cloud.o-forge.io/core/oc-lib v0.0.0-20240801071310-924a688a9d3f h1:w4KMhEFwcJrVhinhuo4G/A/pJZOpHQSA8BB/1LV8aN4= +cloud.o-forge.io/core/oc-lib v0.0.0-20240801071310-924a688a9d3f/go.mod h1:V5EL+NV2s9P1/BcFm3/icfLeBYVVMLl1Z0F0eecJZGo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=