1 Star 0 Fork 0

余济舟/aid

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
redis.set.go 835 Bytes
Copy Edit Raw Blame History
余济舟 authored 2025-08-29 14:49 +08:00 . optimize
package redisPool
import "gitee.com/jericho-yu/aid/honestMan"
type RedisSetting struct {
Host string `yaml:"host"`
Port int `yaml:"port"`
Password string `yaml:"password"`
Prefix string `yaml:"prefix"`
Pool []struct {
Key string `yaml:"key"`
Prefix string `yaml:"prefix"`
DbNum int `yaml:"dbNum"`
}
}
// New 初始化:数据库配置
func (*RedisSetting) New(path string) *RedisSetting {
var redisSetting *RedisSetting = &RedisSetting{}
err := honestMan.HonestManApp.New(path).LoadYaml(redisSetting)
if err != nil {
return nil
}
return redisSetting
}
// ExampleYaml 示例配置文件
func (*RedisSetting) ExampleYaml() string {
return `host: 127.0.0.1
port: 6379
password: ""
prefix: "abc-example"
pool:
[
{
key: "auth",
prefix: "auth",
dbNum: 0
}
]`
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jericho-yu/aid.git
git@gitee.com:jericho-yu/aid.git
jericho-yu
aid
aid
v1.35.18

Search