From 111107ac7a688bc64f094115595ceb4b96c3631e Mon Sep 17 00:00:00 2001 From: wubijie Date: Mon, 26 Jun 2023 11:39:01 +0800 Subject: [PATCH] Increase Redis information database storage --- redis/server/config.yml.templete | 6 ++++++ redis/server/config/config.go | 9 +++++++++ redis/server/global/global.go | 2 ++ 3 files changed, 17 insertions(+) diff --git a/redis/server/config.yml.templete b/redis/server/config.yml.templete index 42a65bdf..3c0a8be4 100644 --- a/redis/server/config.yml.templete +++ b/redis/server/config.yml.templete @@ -9,3 +9,9 @@ log: path: ./log/plugin_redis.log max_file: 1 max_size: 10485760 +mysql: + host:localhost + port:3306 + user:'' + password:'' + database:PluginRedis \ No newline at end of file diff --git a/redis/server/config/config.go b/redis/server/config/config.go index 3892a76c..94914492 100644 --- a/redis/server/config/config.go +++ b/redis/server/config/config.go @@ -18,10 +18,19 @@ type HttpConf struct { Addr string `yaml:"addr"` } +type MysqlDBInfo struct { + HostName string `yaml:"host"` + Port int `yaml:"port"` + UserName string `yaml:"user"` + Password string `yaml:"password"` + DataBase string `yaml:"database"` +} + type ServerConfig struct { Redis *Redis `yaml:"redis"` Http *HttpConf `yaml:"http"` Logopts *logger.LogOpts `yaml:"log"` + Mysql *MysqlDBInfo `yaml:"mysql"` } const config_file = "./config.yml" diff --git a/redis/server/global/global.go b/redis/server/global/global.go index d3509fa7..a96e4dde 100644 --- a/redis/server/global/global.go +++ b/redis/server/global/global.go @@ -2,8 +2,10 @@ package global import ( "gitee.com/openeuler/PilotGo-plugins/sdk/plugin/client" + "gorm.io/gorm" ) var ( GlobalClient *client.Client + GlobalDB *gorm.DB ) -- Gitee