From 24c70fbb41ad2273031b0d3c298cd6a6f76974f7 Mon Sep 17 00:00:00 2001 From: Wangjunqi123 Date: Fri, 14 Jun 2024 15:49:15 +0800 Subject: [PATCH] template: initialize template plugin --- elk/handler/search.go | 7 +++++++ template/server/go.mod | 3 +++ template/server/main.go | 5 +++++ template/server/template.yml | 0 4 files changed, 15 insertions(+) create mode 100644 template/server/go.mod create mode 100644 template/server/main.go create mode 100644 template/server/template.yml diff --git a/elk/handler/search.go b/elk/handler/search.go index f7e5f153..462541a5 100644 --- a/elk/handler/search.go +++ b/elk/handler/search.go @@ -16,6 +16,13 @@ import ( func SearchHandle(ctx *gin.Context) { index := ctx.Query("index") + if index == "" { + err := errors.Errorf("%+v **warn**0", "index is null") + errormanager.ErrorTransmit(pluginclient.Global_Context, err, false) + response.Fail(ctx, nil, err.Error()) + return + } + defer ctx.Request.Body.Close() if elasticClient.Global_elastic.Client == nil { err := errors.Errorf("%+v **warn**0", "global_elastic is null") diff --git a/template/server/go.mod b/template/server/go.mod new file mode 100644 index 00000000..0d501559 --- /dev/null +++ b/template/server/go.mod @@ -0,0 +1,3 @@ +module template + +go 1.20 diff --git a/template/server/main.go b/template/server/main.go new file mode 100644 index 00000000..d3103f97 --- /dev/null +++ b/template/server/main.go @@ -0,0 +1,5 @@ +package main + +func main() { + +} \ No newline at end of file diff --git a/template/server/template.yml b/template/server/template.yml new file mode 100644 index 00000000..e69de29b -- Gitee