From 8189a1ba7a74d9575af6d5bc43de311f1d2ba57b Mon Sep 17 00:00:00 2001 From: mr Date: Fri, 30 Aug 2024 10:58:29 +0200 Subject: [PATCH] latest oclib + comments --- controllers/workflow_execution.go | 9 +++++++++ go.mod | 2 +- go.sum | 2 ++ main.go | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/controllers/workflow_execution.go b/controllers/workflow_execution.go index 943cede..1350d89 100644 --- a/controllers/workflow_execution.go +++ b/controllers/workflow_execution.go @@ -21,6 +21,15 @@ type WorkflowExecutionController struct { // @Success 200 {workspace} models.workspace // @router /search/:start_date/:end_date [get] func (o *WorkflowExecutionController) Search() { + /* + * This is a sample of how to use the search function + * The search function is used to search for data in the database + * The search function takes in a filter and a data type + * The filter is a struct that contains the search parameters + * The data type is an enum that specifies the type of data to search for + * The search function returns a list of data that matches the filter + * The data is then returned as a json object + */ // store and return Id or post with UUID start_date, _ := time.Parse("2006-01-02", o.Ctx.Input.Param(":start_date")) end_date, _ := time.Parse("2006-01-02", o.Ctx.Input.Param(":end_date")) diff --git a/go.mod b/go.mod index 347e1ea..c27b11e 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( ) require ( - cloud.o-forge.io/core/oc-lib v0.0.0-20240828114159-ede91cde4583 // indirect + cloud.o-forge.io/core/oc-lib v0.0.0-20240830071403-db78c70dc349 // 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 29efba1..a629e24 100644 --- a/go.sum +++ b/go.sum @@ -158,6 +158,8 @@ cloud.o-forge.io/core/oc-lib v0.0.0-20240821093044-f64563c9ff06 h1:sYveE1C/0mpSr cloud.o-forge.io/core/oc-lib v0.0.0-20240821093044-f64563c9ff06/go.mod h1:1hhYh5QWAbYw9cKplQ0ZD9PMgU8t6gPqiYF8sldv1HU= cloud.o-forge.io/core/oc-lib v0.0.0-20240828114159-ede91cde4583 h1:5DVFZLJ4tySspQwk0H1HRR+arWSRsYsujP4N8zxvy2Q= cloud.o-forge.io/core/oc-lib v0.0.0-20240828114159-ede91cde4583/go.mod h1:1hhYh5QWAbYw9cKplQ0ZD9PMgU8t6gPqiYF8sldv1HU= +cloud.o-forge.io/core/oc-lib v0.0.0-20240830071403-db78c70dc349 h1:bEIY1lCsA78/mJqFE0gV6likAv5ZifH3RMnLJxiSk3o= +cloud.o-forge.io/core/oc-lib v0.0.0-20240830071403-db78c70dc349/go.mod h1:FIJD0taWLJ5pjQLJ6sfE2KlTkvbmk5SMcyrxdjsaVz0= 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= diff --git a/main.go b/main.go index f52f545..9a6de88 100644 --- a/main.go +++ b/main.go @@ -29,6 +29,7 @@ func main() { o.GetStringDefault("MONGO_DATABASE", "DC_myDC"), "", ) + // Init OC with hostname and port for discovery purpose oclib.Init("oc-scheduler", o.GetStringDefault("HOSTNAME", "localhost"), o.GetStringDefault("PORT", "8090")) // Normal beego init //if beego.BConfig.RunMode == "dev" {