From 45e304d028471aa9a898f2c4da331f6df89a68f3 Mon Sep 17 00:00:00 2001 From: Wangjunqi123 Date: Wed, 26 Jun 2024 10:01:29 +0800 Subject: [PATCH] server: move go module out of server/ --- server/go.mod => go.mod | 0 server/go.sum => go.sum | 0 server/conf/config.go | 2 +- server/elasticClient/client.go | 8 ++++---- server/errormanager/errormanager.go | 2 +- server/handler/meta.go | 4 ++-- server/handler/router.go | 8 ++++---- server/handler/searchHandle.go | 8 ++++---- server/kibanaClient/7_17_16/client.go | 10 +++++----- .../kibanaClient/7_17_16/clientFleetAPI+.go | 4 ++-- server/kibanaClient/7_17_16/gjsonProcess.go | 2 +- server/kibanaClient/8_13_0/client.go | 10 +++++----- server/kibanaClient/8_13_0/clientFleetAPI+.go | 4 ++-- server/kibanaClient/8_13_0/gjsonProcess.go | 2 +- server/logger/sdkLogger.go | 6 +++--- server/main.go | 19 +++++++++---------- server/service/cluster/LogTimeAixs.go | 2 +- 17 files changed, 45 insertions(+), 46 deletions(-) rename server/go.mod => go.mod (100%) rename server/go.sum => go.sum (100%) diff --git a/server/go.mod b/go.mod similarity index 100% rename from server/go.mod rename to go.mod diff --git a/server/go.sum b/go.sum similarity index 100% rename from server/go.sum rename to go.sum diff --git a/server/conf/config.go b/server/conf/config.go index 715df19..46b9509 100644 --- a/server/conf/config.go +++ b/server/conf/config.go @@ -6,7 +6,7 @@ import ( "os" "path" - "gitee.com/openeuler/PilotGo-plugin-elk/global" + "gitee.com/openeuler/PilotGo-plugin-elk/server/global" "gitee.com/openeuler/PilotGo/sdk/logger" "github.com/pkg/errors" "gopkg.in/yaml.v2" diff --git a/server/elasticClient/client.go b/server/elasticClient/client.go index 282c439..cb0fa0e 100644 --- a/server/elasticClient/client.go +++ b/server/elasticClient/client.go @@ -14,10 +14,10 @@ import ( "github.com/pkg/errors" - "gitee.com/openeuler/PilotGo-plugin-elk/conf" - "gitee.com/openeuler/PilotGo-plugin-elk/errormanager" - "gitee.com/openeuler/PilotGo-plugin-elk/global/template" - "gitee.com/openeuler/PilotGo-plugin-elk/pluginclient" + "gitee.com/openeuler/PilotGo-plugin-elk/server/conf" + "gitee.com/openeuler/PilotGo-plugin-elk/server/errormanager" + "gitee.com/openeuler/PilotGo-plugin-elk/server/global/template" + "gitee.com/openeuler/PilotGo-plugin-elk/server/pluginclient" elastic "github.com/elastic/go-elasticsearch/v7" "github.com/elastic/go-elasticsearch/v7/esapi" ) diff --git a/server/errormanager/errormanager.go b/server/errormanager/errormanager.go index 979dffc..ba373bb 100644 --- a/server/errormanager/errormanager.go +++ b/server/errormanager/errormanager.go @@ -6,7 +6,7 @@ import ( "os" "strings" - "gitee.com/openeuler/PilotGo-plugin-elk/conf" + "gitee.com/openeuler/PilotGo-plugin-elk/server/conf" "gitee.com/openeuler/PilotGo/sdk/logger" "github.com/pkg/errors" ) diff --git a/server/handler/meta.go b/server/handler/meta.go index f023928..23035fc 100644 --- a/server/handler/meta.go +++ b/server/handler/meta.go @@ -1,8 +1,8 @@ package handler import ( - "gitee.com/openeuler/PilotGo-plugin-elk/errormanager" - "gitee.com/openeuler/PilotGo-plugin-elk/pluginclient" + "gitee.com/openeuler/PilotGo-plugin-elk/server/errormanager" + "gitee.com/openeuler/PilotGo-plugin-elk/server/pluginclient" "gitee.com/openeuler/PilotGo/sdk/response" "github.com/gin-gonic/gin" "github.com/pkg/errors" diff --git a/server/handler/router.go b/server/handler/router.go index 5a3401b..cc9f73e 100644 --- a/server/handler/router.go +++ b/server/handler/router.go @@ -7,9 +7,9 @@ import ( "github.com/gin-contrib/timeout" - "gitee.com/openeuler/PilotGo-plugin-elk/conf" - "gitee.com/openeuler/PilotGo-plugin-elk/errormanager" - "gitee.com/openeuler/PilotGo-plugin-elk/pluginclient" + "gitee.com/openeuler/PilotGo-plugin-elk/server/conf" + "gitee.com/openeuler/PilotGo-plugin-elk/server/errormanager" + "gitee.com/openeuler/PilotGo-plugin-elk/server/pluginclient" "github.com/gin-gonic/gin" "github.com/pkg/errors" ) @@ -48,7 +48,7 @@ func InitRouter(router *gin.Engine) { api := router.Group("/plugin/elk/api") { api.POST("/create_policy", CreatePolicyHandle) - api.POST("/log_time_axis_data", Search_LogTimeAxisDataHandle) + api.POST("/log_timeaxis_data", Search_LogTimeAxisDataHandle) } timeoutapi := router.Group("/plugin/elk/api") diff --git a/server/handler/searchHandle.go b/server/handler/searchHandle.go index bec61f5..49024f1 100644 --- a/server/handler/searchHandle.go +++ b/server/handler/searchHandle.go @@ -6,10 +6,10 @@ import ( "github.com/pkg/errors" - "gitee.com/openeuler/PilotGo-plugin-elk/elasticClient" - "gitee.com/openeuler/PilotGo-plugin-elk/errormanager" - "gitee.com/openeuler/PilotGo-plugin-elk/pluginclient" - "gitee.com/openeuler/PilotGo-plugin-elk/service/cluster" + "gitee.com/openeuler/PilotGo-plugin-elk/server/elasticClient" + "gitee.com/openeuler/PilotGo-plugin-elk/server/errormanager" + "gitee.com/openeuler/PilotGo-plugin-elk/server/pluginclient" + "gitee.com/openeuler/PilotGo-plugin-elk/server/service/cluster" "gitee.com/openeuler/PilotGo/sdk/response" "github.com/gin-gonic/gin" ) diff --git a/server/kibanaClient/7_17_16/client.go b/server/kibanaClient/7_17_16/client.go index c22f24a..e22ef24 100644 --- a/server/kibanaClient/7_17_16/client.go +++ b/server/kibanaClient/7_17_16/client.go @@ -7,11 +7,11 @@ import ( "github.com/pkg/errors" - "gitee.com/openeuler/PilotGo-plugin-elk/conf" - "gitee.com/openeuler/PilotGo-plugin-elk/errormanager" - "gitee.com/openeuler/PilotGo-plugin-elk/global" - "gitee.com/openeuler/PilotGo-plugin-elk/kibanaClient/7_17_16/meta" - "gitee.com/openeuler/PilotGo-plugin-elk/pluginclient" + "gitee.com/openeuler/PilotGo-plugin-elk/server/conf" + "gitee.com/openeuler/PilotGo-plugin-elk/server/errormanager" + "gitee.com/openeuler/PilotGo-plugin-elk/server/global" + "gitee.com/openeuler/PilotGo-plugin-elk/server/kibanaClient/7_17_16/meta" + "gitee.com/openeuler/PilotGo-plugin-elk/server/pluginclient" "github.com/elastic/elastic-agent-libs/kibana" "github.com/elastic/elastic-agent-libs/transport/httpcommon" "github.com/elastic/elastic-agent-libs/transport/tlscommon" diff --git a/server/kibanaClient/7_17_16/clientFleetAPI+.go b/server/kibanaClient/7_17_16/clientFleetAPI+.go index 85a31b7..d8a4b9d 100644 --- a/server/kibanaClient/7_17_16/clientFleetAPI+.go +++ b/server/kibanaClient/7_17_16/clientFleetAPI+.go @@ -8,9 +8,9 @@ import ( "io" "net/http" - "gitee.com/openeuler/PilotGo-plugin-elk/kibanaClient/7_17_16/meta" + "gitee.com/openeuler/PilotGo-plugin-elk/server/kibanaClient/7_17_16/meta" "github.com/elastic/elastic-agent-libs/kibana" - "gitee.com/openeuler/PilotGo-plugin-elk/global" + "gitee.com/openeuler/PilotGo-plugin-elk/server/global" ) func (client *KibanaClient_v7) GetPackageInfo(ctx context.Context, pkgname string) (*meta.PackageInfo_p, error) { diff --git a/server/kibanaClient/7_17_16/gjsonProcess.go b/server/kibanaClient/7_17_16/gjsonProcess.go index 8d6c2ab..545fdc5 100644 --- a/server/kibanaClient/7_17_16/gjsonProcess.go +++ b/server/kibanaClient/7_17_16/gjsonProcess.go @@ -3,7 +3,7 @@ package kibanaClient import ( "github.com/tidwall/gjson" - "gitee.com/openeuler/PilotGo-plugin-elk/kibanaClient/7_17_16/meta" + "gitee.com/openeuler/PilotGo-plugin-elk/server/kibanaClient/7_17_16/meta" ) /* diff --git a/server/kibanaClient/8_13_0/client.go b/server/kibanaClient/8_13_0/client.go index dfaed38..b036eb9 100644 --- a/server/kibanaClient/8_13_0/client.go +++ b/server/kibanaClient/8_13_0/client.go @@ -6,11 +6,11 @@ import ( "github.com/pkg/errors" - "gitee.com/openeuler/PilotGo-plugin-elk/conf" - "gitee.com/openeuler/PilotGo-plugin-elk/errormanager" - "gitee.com/openeuler/PilotGo-plugin-elk/global" - "gitee.com/openeuler/PilotGo-plugin-elk/kibanaClient/8_13_0/meta" - "gitee.com/openeuler/PilotGo-plugin-elk/pluginclient" + "gitee.com/openeuler/PilotGo-plugin-elk/server/conf" + "gitee.com/openeuler/PilotGo-plugin-elk/server/errormanager" + "gitee.com/openeuler/PilotGo-plugin-elk/server/global" + "gitee.com/openeuler/PilotGo-plugin-elk/server/kibanaClient/8_13_0/meta" + "gitee.com/openeuler/PilotGo-plugin-elk/server/pluginclient" "github.com/elastic/elastic-agent-libs/kibana" ) diff --git a/server/kibanaClient/8_13_0/clientFleetAPI+.go b/server/kibanaClient/8_13_0/clientFleetAPI+.go index 6af65a7..62a5672 100644 --- a/server/kibanaClient/8_13_0/clientFleetAPI+.go +++ b/server/kibanaClient/8_13_0/clientFleetAPI+.go @@ -8,8 +8,8 @@ import ( "io" "net/http" - "gitee.com/openeuler/PilotGo-plugin-elk/kibanaClient/8_13_0/meta" - "gitee.com/openeuler/PilotGo-plugin-elk/global" + "gitee.com/openeuler/PilotGo-plugin-elk/server/kibanaClient/8_13_0/meta" + "gitee.com/openeuler/PilotGo-plugin-elk/server/global" "github.com/elastic/elastic-agent-libs/kibana" ) diff --git a/server/kibanaClient/8_13_0/gjsonProcess.go b/server/kibanaClient/8_13_0/gjsonProcess.go index 6c58862..488e45b 100644 --- a/server/kibanaClient/8_13_0/gjsonProcess.go +++ b/server/kibanaClient/8_13_0/gjsonProcess.go @@ -1,7 +1,7 @@ package kibanaClient import ( - "gitee.com/openeuler/PilotGo-plugin-elk/kibanaClient/8_13_0/meta" + "gitee.com/openeuler/PilotGo-plugin-elk/server/kibanaClient/8_13_0/meta" "github.com/tidwall/gjson" ) diff --git a/server/logger/sdkLogger.go b/server/logger/sdkLogger.go index 8ac7880..e42b5e1 100644 --- a/server/logger/sdkLogger.go +++ b/server/logger/sdkLogger.go @@ -1,9 +1,9 @@ package logger import ( - "gitee.com/openeuler/PilotGo-plugin-elk/conf" - "gitee.com/openeuler/PilotGo-plugin-elk/errormanager" - "gitee.com/openeuler/PilotGo-plugin-elk/pluginclient" + "gitee.com/openeuler/PilotGo-plugin-elk/server/conf" + "gitee.com/openeuler/PilotGo-plugin-elk/server/errormanager" + "gitee.com/openeuler/PilotGo-plugin-elk/server/pluginclient" "gitee.com/openeuler/PilotGo/sdk/logger" "github.com/pkg/errors" ) diff --git a/server/main.go b/server/main.go index acbb48c..59976c3 100644 --- a/server/main.go +++ b/server/main.go @@ -1,15 +1,15 @@ package main import ( - "gitee.com/openeuler/PilotGo-plugin-elk/conf" - "gitee.com/openeuler/PilotGo-plugin-elk/db" - "gitee.com/openeuler/PilotGo-plugin-elk/elasticClient" - "gitee.com/openeuler/PilotGo-plugin-elk/errormanager" - "gitee.com/openeuler/PilotGo-plugin-elk/handler" - kibanaclient "gitee.com/openeuler/PilotGo-plugin-elk/kibanaClient/7_17_16" - "gitee.com/openeuler/PilotGo-plugin-elk/logger" - "gitee.com/openeuler/PilotGo-plugin-elk/pluginclient" - "gitee.com/openeuler/PilotGo-plugin-elk/signal" + "gitee.com/openeuler/PilotGo-plugin-elk/server/conf" + "gitee.com/openeuler/PilotGo-plugin-elk/server/db" + "gitee.com/openeuler/PilotGo-plugin-elk/server/elasticClient" + "gitee.com/openeuler/PilotGo-plugin-elk/server/errormanager" + "gitee.com/openeuler/PilotGo-plugin-elk/server/handler" + kibanaclient "gitee.com/openeuler/PilotGo-plugin-elk/server/kibanaClient/7_17_16" + "gitee.com/openeuler/PilotGo-plugin-elk/server/logger" + "gitee.com/openeuler/PilotGo-plugin-elk/server/pluginclient" + "gitee.com/openeuler/PilotGo-plugin-elk/server/signal" ) func main() { @@ -40,7 +40,6 @@ func main() { /* init database - neo4j mysql redis prometheus */ db.InitDB() diff --git a/server/service/cluster/LogTimeAixs.go b/server/service/cluster/LogTimeAixs.go index 8571220..0360bc2 100644 --- a/server/service/cluster/LogTimeAixs.go +++ b/server/service/cluster/LogTimeAixs.go @@ -1,7 +1,7 @@ package cluster import ( - "gitee.com/openeuler/PilotGo-plugin-elk/elasticClient" + "gitee.com/openeuler/PilotGo-plugin-elk/server/elasticClient" "github.com/pkg/errors" "github.com/tidwall/gjson" ) -- Gitee