diff --git a/configmanage/server/config.yaml.templete b/configmanage/server/config.yaml.templete index e6ffcddd60cf40a778de45e8ff45c9ff55999a71..1c3d6bf9e8986204dd3a96e09da322af690887c8 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 0a93424c03ddd5b15682a11e8a0942aeb382bfe0..0cea442012178c95768479235750eccb896543bc 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 64813e56b7f6dc2ccc3caa677d9a7d5e31b3e562..284c45f1ea3aafba672e6f7d6363fc8380ef8c44 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 a7188c5b722a50198d5e09d541bd408301a0e2a6..26fec74440932559a14042b91d2296554204e6c8 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 0d443369efe4811270823a1b5fe7e9062aef252d..6ed6753915b1f7bde3c5c2f6968d1b72418cb778 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 fc717ab0677ba4968e23270d80d0e1a517d3d27c..b4f5df7e34bdeac5a26b726ca0f06cd7bfbf63d0 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 cfc3a960540085547fe66bbf3fb7b07ddca97137..4021741a55c53e17ea81095456c26c1da9f2e18b 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 d20358235093a32c1d4793c1598c0d8f77712275..d9deeeb9c8e096fd7ab94a27d2e9568c86a77e52 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 35b64f2f4155fddeeb6ec1f962b19fe3869cb242..246ad0fa981f73d0de9ec2af2219530614be5139 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 f04fb70cc00f2e42654b00bc71079677307bacdd..eb7d353b3731a5058e0fc0947edf66dbab6fde14 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 002932c59049d28b74f9ef799b79515258c38a6a..c974453cbd3b7ae7e37b2e42a4467aaa359b2553 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 0afb905494f7f822d223b8141525436588a53ac3..d62d1b629caf04c1ce7e715db7bcadede300bfe7 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 fbbc0662bac05764b6edca8b0b8424386857e8d7..4809fadb77b2386580fc524ee92bb121124dab4e 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 70c8f300bd1dc06aaa1b235b55fa96b7ead1eeb3..559f106dca93b28f57979f468e1f3a8f5831be3a 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 bd742b62497dc8bf35596f06c58947be260addb2..ca623c7aa508fa9db94b8ac70d7dbafed5347c8b 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