From 756f8e5af84cc8e2bb6103c553abebc95cefbdca Mon Sep 17 00:00:00 2001 From: zhanghan Date: Tue, 26 Aug 2025 15:26:16 +0800 Subject: [PATCH] Replace configmanage client registration service discovery --- configmanage/server/config.yaml.templete | 12 ++++++-- configmanage/server/config/config.go | 24 ++++++++------- .../server/global/plugin_configmanage.go | 22 +------------- configmanage/server/main.go | 30 +++++++++++++++---- configmanage/server/router/router.go | 4 +-- configmanage/server/service/dns.go | 16 +++++++--- configmanage/server/service/extentions.go | 11 ++++--- configmanage/server/service/host.go | 15 +++++++--- configmanage/server/service/path.go | 15 +++++++--- configmanage/server/service/repo.go | 15 +++++++--- configmanage/server/service/ssh.go | 15 +++++++--- configmanage/server/service/sshd.go | 15 +++++++--- configmanage/server/service/sysctl.go | 15 +++++++--- event/server/config.yaml.templete | 3 -- event/server/config/config.go | 14 +++------ 15 files changed, 138 insertions(+), 88 deletions(-) diff --git a/configmanage/server/config.yaml.templete b/configmanage/server/config.yaml.templete index e6ffcddd..1c3d6bf9 100644 --- a/configmanage/server/config.yaml.templete +++ b/configmanage/server/config.yaml.templete @@ -1,5 +1,3 @@ -config_plugin: - url: "http://localhost:8099/plugin/config" http_server: addr: "localhost:8099" log: @@ -13,4 +11,12 @@ mysql: port: 3306 user: '' password: '' - database: ConfigPlugin \ No newline at end of file + database: ConfigPlugin +etcd: + endpoints: + - "localhost:2379" + service_name: "configmanage-service" + version: "3.0" + dialTimeout: 5s + menu_name: "配置管理" + icon: "Odometer" \ No newline at end of file diff --git a/configmanage/server/config/config.go b/configmanage/server/config/config.go index 0a93424c..0cea4420 100644 --- a/configmanage/server/config/config.go +++ b/configmanage/server/config/config.go @@ -1,6 +1,6 @@ /* * Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. - * PilotGo-plugin licensed under the Mulan Permissive Software License, Version 2. + * PilotGo-plugin licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: wubijie * Date: Wed Nov 15 14:46:48 2023 +0800 @@ -10,15 +10,12 @@ package config import ( "fmt" "os" + "time" "gitee.com/openeuler/PilotGo/sdk/logger" "gopkg.in/yaml.v2" ) -type ConfigPlugin struct { - URL string `yaml:"url"` -} - type HttpServer struct { Addr string `yaml:"addr"` } @@ -30,12 +27,19 @@ type MysqlDBInfo struct { Password string `yaml:"password"` DataBase string `yaml:"database"` } - +type Etcd struct { + Endpoints []string `yaml:"endpoints"` + ServiveName string `yaml:"service_name"` + Version string `yaml:"version"` + DialTimeout time.Duration `yaml:"dialTimeout"` + MenuName string `yaml:"menu_name"` + Icon string `yaml:"icon"` +} type ServerConfig struct { - ConfigPlugin *ConfigPlugin `yaml:"config_plugin"` - HttpServer *HttpServer `yaml:"http_server"` - Logopts *logger.LogOpts `yaml:"log"` - Mysql *MysqlDBInfo `yaml:"mysql"` + HttpServer *HttpServer `yaml:"http_server"` + Logopts *logger.LogOpts `yaml:"log"` + Mysql *MysqlDBInfo `yaml:"mysql"` + Etcd *Etcd `yaml:"etcd" mapstructure:"etcd"` } var global_config ServerConfig diff --git a/configmanage/server/global/plugin_configmanage.go b/configmanage/server/global/plugin_configmanage.go index 64813e56..284c45f1 100644 --- a/configmanage/server/global/plugin_configmanage.go +++ b/configmanage/server/global/plugin_configmanage.go @@ -1,32 +1,12 @@ /* * Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. - * PilotGo-plugin licensed under the Mulan Permissive Software License, Version 2. + * PilotGo-plugin licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: wubijie * Date: Fri Dec 1 16:30:26 2023 +0800 */ package global -import ( - "gitee.com/openeuler/PilotGo/sdk/plugin/client" - "openeuler.org/PilotGo/configmanage-plugin/config" -) - -const Version = "1.0.1" - -func Init(plugin *config.ConfigPlugin) *client.PluginInfo { - PluginInfo := client.PluginInfo{ - Name: "configmanage", - Version: Version, - Description: "configmanage-plugin", - Author: "wubijie", - Email: "wubijie@kylinos.cn", - Url: plugin.URL, - PluginType: "micro-app", - } - return &PluginInfo -} - const ( Repo = "repo" Host = "host" diff --git a/configmanage/server/main.go b/configmanage/server/main.go index a7188c5b..26fec744 100644 --- a/configmanage/server/main.go +++ b/configmanage/server/main.go @@ -1,6 +1,6 @@ /* * Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. - * PilotGo-plugin licensed under the Mulan Permissive Software License, Version 2. + * PilotGo-plugin licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: wubijie * Date: Wed Nov 15 15:28:38 2023 +0800 @@ -14,6 +14,7 @@ import ( "os/signal" "syscall" + "gitee.com/openeuler/PilotGo/sdk/go-micro/registry" "gitee.com/openeuler/PilotGo/sdk/logger" "gitee.com/openeuler/PilotGo/sdk/plugin/client" "openeuler.org/PilotGo/configmanage-plugin/config" @@ -56,11 +57,30 @@ func main() { os.Exit(-1) } - global.GlobalClient = client.DefaultClient(global.Init(config.Config().ConfigPlugin)) - service.GetTags() - service.AddExtentions() - service.AddPermission() + sr, err := registry.NewServiceRegistrar(®istry.Options{ + Endpoints: config.Config().Etcd.Endpoints, + ServiceAddr: config.Config().HttpServer.Addr, + ServiceName: config.Config().Etcd.ServiveName, + Version: config.Config().Etcd.Version, + MenuName: config.Config().Etcd.MenuName, + Icon: config.Config().Etcd.Icon, + DialTimeout: config.Config().Etcd.DialTimeout, + Extentions: service.GetExtentions(), + Permissions: service.GetPermission(), + }) + if err != nil { + logger.Error("failed to initialize registry: %s", err) + os.Exit(-1) + } + client, err := client.NewClient(config.Config().Etcd.ServiveName, sr.Registry) + if err != nil { + logger.Error("failed to create plugin client: %s", err) + os.Exit(-1) + } + + global.GlobalClient = client + service.GetTags() // 初始化路由信息 server := router.InitRouter() go router.RegisterAPIs(server) diff --git a/configmanage/server/router/router.go b/configmanage/server/router/router.go index 0d443369..6ed67539 100644 --- a/configmanage/server/router/router.go +++ b/configmanage/server/router/router.go @@ -1,6 +1,6 @@ /* * Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. - * PilotGo-plugin licensed under the Mulan Permissive Software License, Version 2. + * PilotGo-plugin licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: wubijie * Date: Fri Dec 1 16:30:26 2023 +0800 @@ -24,7 +24,7 @@ func InitRouter() *gin.Engine { func RegisterAPIs(router *gin.Engine) { //输出插件初始化的信息 global.GlobalClient.RegisterHandlers(router) - api := router.Group("/plugin/" + global.GlobalClient.PluginInfo.Name) + api := router.Group("/plugin/configmanage") { list := api.Group("/list") { diff --git a/configmanage/server/service/dns.go b/configmanage/server/service/dns.go index fc717ab0..b4f5df7e 100644 --- a/configmanage/server/service/dns.go +++ b/configmanage/server/service/dns.go @@ -1,6 +1,6 @@ /* * Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. - * PilotGo-plugin licensed under the Mulan Permissive Software License, Version 2. + * PilotGo-plugin licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: wubijie * Date: Fri Nov 15 15:59:30 2024 +0800 @@ -17,7 +17,6 @@ import ( "gitee.com/openeuler/PilotGo/sdk/common" "gitee.com/openeuler/PilotGo/sdk/logger" - "gitee.com/openeuler/PilotGo/sdk/plugin/client" "gitee.com/openeuler/PilotGo/sdk/utils/httputils" "github.com/google/uuid" "openeuler.org/PilotGo/configmanage-plugin/global" @@ -131,7 +130,12 @@ func (dc *DNSConfig) Apply() ([]NodeResult, error) { DeployFileName: dnsfile.Name, DeployText: dnsfile.Content, } - url := "http://" + client.GetClient().Server() + "/api/v1/pluginapi/file_deploy" + + serverInfo, err := global.GlobalClient.Registry.Get("pilotgo-server") + if err != nil { + return nil, err + } + url := fmt.Sprintf("http://%s:%s/api/v1/pluginapi/file_deploy", serverInfo.Address, serverInfo.Port) r, err := httputils.Post(url, &httputils.Params{ Body: de, }) @@ -209,7 +213,11 @@ func (dc *DNSConfig) Collect() ([]NodeResult, error) { } //发请求获取配置详情 - url := "http://" + client.GetClient().Server() + "/api/v1/pluginapi/getnodefiles" + serverInfo, err := global.GlobalClient.Registry.Get("pilotgo-server") + if err != nil { + return nil, err + } + url := fmt.Sprintf("http://%s:%s/api/v1/pluginapi/getnodefiles", serverInfo.Address, serverInfo.Port) p := struct { DeployBatch common.Batch `json:"deploybatch"` Path string `json:"path"` diff --git a/configmanage/server/service/extentions.go b/configmanage/server/service/extentions.go index cfc3a960..4021741a 100644 --- a/configmanage/server/service/extentions.go +++ b/configmanage/server/service/extentions.go @@ -1,6 +1,6 @@ /* * Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. - * PilotGo-plugin licensed under the Mulan Permissive Software License, Version 2. + * PilotGo-plugin licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: wubijie * Date: Thu Oct 31 14:15:31 2024 +0800 @@ -9,11 +9,10 @@ package service import ( "gitee.com/openeuler/PilotGo/sdk/common" - "openeuler.org/PilotGo/configmanage-plugin/global" ) // 添加扩展点信息 -func AddExtentions() { +func GetExtentions() []common.Extention { var ex []common.Extention pe1 := &common.PageExtention{ Type: common.ExtentionPage, @@ -28,11 +27,11 @@ func AddExtentions() { Permission: "plugin.configmanage.page/menu", } ex = append(ex, pe1, pe2) - global.GlobalClient.RegisterExtention(ex) + return ex } // 添加权限信息 -func AddPermission() { +func GetPermission() []common.Permission { var ps []common.Permission p1 := common.Permission{ Resource: "plugin.configmanage", @@ -43,5 +42,5 @@ func AddPermission() { Operate: "agent_uninstall", } ps = append(ps, p1, p2) - global.GlobalClient.RegisterPermission(ps) + return ps } diff --git a/configmanage/server/service/host.go b/configmanage/server/service/host.go index d2035823..d9deeeb9 100644 --- a/configmanage/server/service/host.go +++ b/configmanage/server/service/host.go @@ -1,6 +1,6 @@ /* * Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. - * PilotGo-plugin licensed under the Mulan Permissive Software License, Version 2. + * PilotGo-plugin licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: wubijie * Date: Mon Nov 4 11:31:01 2024 +0800 @@ -17,7 +17,6 @@ import ( "gitee.com/openeuler/PilotGo/sdk/common" "gitee.com/openeuler/PilotGo/sdk/logger" - "gitee.com/openeuler/PilotGo/sdk/plugin/client" "gitee.com/openeuler/PilotGo/sdk/utils/httputils" "github.com/google/uuid" "openeuler.org/PilotGo/configmanage-plugin/global" @@ -131,7 +130,11 @@ func (hc *HostConfig) Apply() ([]NodeResult, error) { DeployFileName: hostfile.Name, DeployText: hostfile.Content, } - url := "http://" + client.GetClient().Server() + "/api/v1/pluginapi/file_deploy" + serverInfo, err := global.GlobalClient.Registry.Get("pilotgo-server") + if err != nil { + return nil, err + } + url := fmt.Sprintf("http://%s:%s/api/v1/pluginapi/file_deploy", serverInfo.Address, serverInfo.Port) r, err := httputils.Post(url, &httputils.Params{ Body: de, }) @@ -209,7 +212,11 @@ func (hc *HostConfig) Collect() ([]NodeResult, error) { } //发请求获取配置详情 - url := "http://" + client.GetClient().Server() + "/api/v1/pluginapi/getnodefiles" + serverInfo, err := global.GlobalClient.Registry.Get("pilotgo-server") + if err != nil { + return nil, err + } + url := fmt.Sprintf("http://%s:%s/api/v1/pluginapi/getnodefiles", serverInfo.Address, serverInfo.Port) p := struct { DeployBatch common.Batch `json:"deploybatch"` Path string `json:"path"` diff --git a/configmanage/server/service/path.go b/configmanage/server/service/path.go index 35b64f2f..246ad0fa 100644 --- a/configmanage/server/service/path.go +++ b/configmanage/server/service/path.go @@ -1,6 +1,6 @@ /* * Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. - * PilotGo-plugin licensed under the Mulan Permissive Software License, Version 2. + * PilotGo-plugin licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: wubijie * Date: Tue Nov 26 15:36:42 2024 +0800 @@ -17,7 +17,6 @@ import ( "gitee.com/openeuler/PilotGo/sdk/common" "gitee.com/openeuler/PilotGo/sdk/logger" - "gitee.com/openeuler/PilotGo/sdk/plugin/client" "gitee.com/openeuler/PilotGo/sdk/utils/httputils" "github.com/google/uuid" "openeuler.org/PilotGo/configmanage-plugin/global" @@ -130,7 +129,11 @@ func (pc *PathConfig) Apply() ([]NodeResult, error) { DeployFileName: pathfile.Name, DeployText: pathfile.Content, } - url := "http://" + client.GetClient().Server() + "/api/v1/pluginapi/file_deploy" + serverInfo, err := global.GlobalClient.Registry.Get("pilotgo-server") + if err != nil { + return nil, err + } + url := fmt.Sprintf("http://%s:%s/api/v1/pluginapi/file_deploy", serverInfo.Address, serverInfo.Port) r, err := httputils.Post(url, &httputils.Params{ Body: de, }) @@ -208,7 +211,11 @@ func (pc *PathConfig) Collect() ([]NodeResult, error) { } //发请求获取配置详情 - url := "http://" + client.GetClient().Server() + "/api/v1/pluginapi/getnodefiles" + serverInfo, err := global.GlobalClient.Registry.Get("pilotgo-server") + if err != nil { + return nil, err + } + url := fmt.Sprintf("http://%s:%s/api/v1/pluginapi/getnodefiles", serverInfo.Address, serverInfo.Port) p := struct { DeployBatch common.Batch `json:"deploybatch"` Path string `json:"path"` diff --git a/configmanage/server/service/repo.go b/configmanage/server/service/repo.go index f04fb70c..eb7d353b 100644 --- a/configmanage/server/service/repo.go +++ b/configmanage/server/service/repo.go @@ -1,6 +1,6 @@ /* * Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. - * PilotGo-plugin licensed under the Mulan Permissive Software License, Version 2. + * PilotGo-plugin licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: wubijie * Date: Wed Dec 6 15:46:19 2023 +0800 @@ -17,7 +17,6 @@ import ( "gitee.com/openeuler/PilotGo/sdk/common" "gitee.com/openeuler/PilotGo/sdk/logger" - "gitee.com/openeuler/PilotGo/sdk/plugin/client" "gitee.com/openeuler/PilotGo/sdk/utils/httputils" "github.com/google/uuid" "openeuler.org/PilotGo/configmanage-plugin/global" @@ -137,7 +136,11 @@ func (rc *RepoConfig) Apply() ([]NodeResult, error) { DeployFileName: v.Name, DeployText: v.Content, } - url := "http://" + client.GetClient().Server() + "/api/v1/pluginapi/file_deploy" + serverInfo, err := global.GlobalClient.Registry.Get("pilotgo-server") + if err != nil { + return nil, err + } + url := fmt.Sprintf("http://%s:%s/api/v1/pluginapi/file_deploy", serverInfo.Address, serverInfo.Port) r, err := httputils.Post(url, &httputils.Params{ Body: de, }) @@ -216,7 +219,11 @@ func (rc *RepoConfig) Collect() ([]NodeResult, error) { } //发请求获取配置详情 - url := "http://" + client.GetClient().Server() + "/api/v1/pluginapi/getnodefiles" + serverInfo, err := global.GlobalClient.Registry.Get("pilotgo-server") + if err != nil { + return nil, err + } + url := fmt.Sprintf("http://%s:%s/api/v1/pluginapi/getnodefiles", serverInfo.Address, serverInfo.Port) p := struct { DeployBatch common.Batch `json:"deploybatch"` Path string `json:"path"` diff --git a/configmanage/server/service/ssh.go b/configmanage/server/service/ssh.go index 002932c5..c974453c 100644 --- a/configmanage/server/service/ssh.go +++ b/configmanage/server/service/ssh.go @@ -1,6 +1,6 @@ /* * Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. - * PilotGo-plugin licensed under the Mulan Permissive Software License, Version 2. + * PilotGo-plugin licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: wubijie * Date: Tue Nov 5 11:20:32 2024 +0800 @@ -17,7 +17,6 @@ import ( "gitee.com/openeuler/PilotGo/sdk/common" "gitee.com/openeuler/PilotGo/sdk/logger" - "gitee.com/openeuler/PilotGo/sdk/plugin/client" "gitee.com/openeuler/PilotGo/sdk/utils/httputils" "github.com/google/uuid" "openeuler.org/PilotGo/configmanage-plugin/global" @@ -130,7 +129,11 @@ func (sc *SSHConfig) Apply() ([]NodeResult, error) { DeployFileName: sshfile.Name, DeployText: sshfile.Content, } - url := "http://" + client.GetClient().Server() + "/api/v1/pluginapi/file_deploy" + serverInfo, err := global.GlobalClient.Registry.Get("pilotgo-server") + if err != nil { + return nil, err + } + url := fmt.Sprintf("http://%s:%s/api/v1/pluginapi/file_deploy", serverInfo.Address, serverInfo.Port) r, err := httputils.Post(url, &httputils.Params{ Body: de, }) @@ -208,7 +211,11 @@ func (sc *SSHConfig) Collect() ([]NodeResult, error) { } //发请求获取配置详情 - url := "http://" + client.GetClient().Server() + "/api/v1/pluginapi/getnodefiles" + serverInfo, err := global.GlobalClient.Registry.Get("pilotgo-server") + if err != nil { + return nil, err + } + url := fmt.Sprintf("http://%s:%s/api/v1/pluginapi/getnodefiles", serverInfo.Address, serverInfo.Port) p := struct { DeployBatch common.Batch `json:"deploybatch"` Path string `json:"path"` diff --git a/configmanage/server/service/sshd.go b/configmanage/server/service/sshd.go index 0afb9054..d62d1b62 100644 --- a/configmanage/server/service/sshd.go +++ b/configmanage/server/service/sshd.go @@ -1,6 +1,6 @@ /* * Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. - * PilotGo-plugin licensed under the Mulan Permissive Software License, Version 2. + * PilotGo-plugin licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: wubijie * Date: Wed Nov 6 09:40:00 2024 +0800 @@ -17,7 +17,6 @@ import ( "gitee.com/openeuler/PilotGo/sdk/common" "gitee.com/openeuler/PilotGo/sdk/logger" - "gitee.com/openeuler/PilotGo/sdk/plugin/client" "gitee.com/openeuler/PilotGo/sdk/utils/httputils" "github.com/google/uuid" "openeuler.org/PilotGo/configmanage-plugin/global" @@ -132,7 +131,11 @@ func (sdc *SSHDConfig) Apply() ([]NodeResult, error) { DeployFileName: sshdfile.Name, DeployText: sshdfile.Content, } - url := "http://" + client.GetClient().Server() + "/api/v1/pluginapi/file_deploy" + serverInfo, err := global.GlobalClient.Registry.Get("pilotgo-server") + if err != nil { + return nil, err + } + url := fmt.Sprintf("http://%s:%s/api/v1/pluginapi/file_deploy", serverInfo.Address, serverInfo.Port) r, err := httputils.Post(url, &httputils.Params{ Body: de, }) @@ -210,7 +213,11 @@ func (sdc *SSHDConfig) Collect() ([]NodeResult, error) { } //发请求获取配置详情 - url := "http://" + client.GetClient().Server() + "/api/v1/pluginapi/getnodefiles" + serverInfo, err := global.GlobalClient.Registry.Get("pilotgo-server") + if err != nil { + return nil, err + } + url := fmt.Sprintf("http://%s:%s/api/v1/pluginapi/getnodefiles", serverInfo.Address, serverInfo.Port) p := struct { DeployBatch common.Batch `json:"deploybatch"` Path string `json:"path"` diff --git a/configmanage/server/service/sysctl.go b/configmanage/server/service/sysctl.go index fbbc0662..4809fadb 100644 --- a/configmanage/server/service/sysctl.go +++ b/configmanage/server/service/sysctl.go @@ -1,6 +1,6 @@ /* * Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. - * PilotGo-plugin licensed under the Mulan Permissive Software License, Version 2. + * PilotGo-plugin licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: wubijie * Date: Thu Nov 7 10:19:32 2024 +0800 @@ -17,7 +17,6 @@ import ( "gitee.com/openeuler/PilotGo/sdk/common" "gitee.com/openeuler/PilotGo/sdk/logger" - "gitee.com/openeuler/PilotGo/sdk/plugin/client" "gitee.com/openeuler/PilotGo/sdk/utils/httputils" "github.com/google/uuid" "openeuler.org/PilotGo/configmanage-plugin/global" @@ -142,7 +141,11 @@ func (sysc *SysctlConfig) Apply() ([]NodeResult, error) { DeployFileName: sysctlfile.Name, DeployText: sysctlfile.Content, } - url := "http://" + client.GetClient().Server() + "/api/v1/pluginapi/file_deploy" + serverInfo, err := global.GlobalClient.Registry.Get("pilotgo-server") + if err != nil { + return nil, err + } + url := fmt.Sprintf("http://%s:%s/api/v1/pluginapi/file_deploy", serverInfo.Address, serverInfo.Port) r, err := httputils.Post(url, &httputils.Params{ Body: de, }) @@ -220,7 +223,11 @@ func (sysc *SysctlConfig) Collect() ([]NodeResult, error) { } //发请求获取配置详情 - url := "http://" + client.GetClient().Server() + "/api/v1/pluginapi/getnodefiles" + serverInfo, err := global.GlobalClient.Registry.Get("pilotgo-server") + if err != nil { + return nil, err + } + url := fmt.Sprintf("http://%s:%s/api/v1/pluginapi/getnodefiles", serverInfo.Address, serverInfo.Port) p := struct { DeployBatch common.Batch `json:"deploybatch"` Path string `json:"path"` diff --git a/event/server/config.yaml.templete b/event/server/config.yaml.templete index 70c8f300..559f106d 100644 --- a/event/server/config.yaml.templete +++ b/event/server/config.yaml.templete @@ -1,6 +1,3 @@ -plugin_event: - url: "http://localhost:8809" - plugin_type: "iframe" # iframe micro-app http_server: addr: "localhost:8809" log: diff --git a/event/server/config/config.go b/event/server/config/config.go index bd742b62..ca623c7a 100644 --- a/event/server/config/config.go +++ b/event/server/config/config.go @@ -15,11 +15,6 @@ import ( "gitee.com/openeuler/PilotGo/sdk/utils/config" ) -type PluginEvent struct { - URL string `yaml:"url"` - PluginType string `yaml:"plugin_type"` -} - type HttpServer struct { Addr string `yaml:"addr"` } @@ -40,11 +35,10 @@ type Etcd struct { Icon string `yaml:"icon"` } type ServerConfig struct { - PluginEvent *PluginEvent `yaml:"plugin_event"` - HttpServer *HttpServer `yaml:"http_server"` - Logopts *logger.LogOpts `yaml:"log"` - Influxd *Influxd `yaml:"influxd"` - Etcd *Etcd `yaml:"etcd" mapstructure:"etcd"` + HttpServer *HttpServer `yaml:"http_server"` + Logopts *logger.LogOpts `yaml:"log"` + Influxd *Influxd `yaml:"influxd"` + Etcd *Etcd `yaml:"etcd" mapstructure:"etcd"` } var config_file string -- Gitee