支持配置选择使用的数据库

This commit is contained in:
白茶清欢 2024-06-20 18:44:55 +08:00
parent e8b63fb863
commit 27e193a0ea
2 changed files with 2 additions and 0 deletions

View File

@ -145,6 +145,7 @@ func (o *OwnClient) GetRealClientWithError(instanceFlag string) (*redisClient.Cl
func (o *OwnClient) AddClient(instanceFlag string, instanceConfig *define.Options) error {
instance := redisClient.NewClient(&redisClient.Options{
DB: instanceConfig.DB,
Addr: instanceConfig.Addr,
ClientName: instanceConfig.ClientName,
Dialer: nil,

View File

@ -8,6 +8,7 @@
package define
type Options struct {
DB int `json:"db" yaml:"db" ini:"db" toml:"db"` // 选择的数据库序号
Network string `json:"network" yaml:"network" ini:"network" toml:"network"` // 网络连接方式
// A seed list of host:port addresses of cluster nodes.
Addr string `json:"addr" yaml:"addr" ini:"addr" toml:"addr"` // 集群IP列表