File tree 4 files changed +25
-0
lines changed
4 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,11 @@ plugin:
29
29
other : Endpoint
30
30
description :
31
31
other : Redis connection address, such as 127.0.0.1:6379
32
+ username :
33
+ title :
34
+ other : Username
35
+ description :
36
+ other : Redis username
32
37
password :
33
38
title :
34
39
other : Password
Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ const (
25
25
26
26
ConfigEndpointTitle = "plugin.redis_cache.backend.config.endpoint.title"
27
27
ConfigEndpointDescription = "plugin.redis_cache.backend.config.endpoint.description"
28
+ ConfigUsernameTitle = "plugin.redis_cache.backend.config.username.title"
29
+ ConfigUsernameDescription = "plugin.redis_cache.backend.config.username.description"
28
30
ConfigPasswordTitle = "plugin.redis_cache.backend.config.password.title"
29
31
ConfigPasswordDescription = "plugin.redis_cache.backend.config.password.description"
30
32
)
Original file line number Diff line number Diff line change @@ -29,6 +29,11 @@ plugin:
29
29
other : Endpoint
30
30
description :
31
31
other : Redis的链接地址,如:127.0.0.1:6379
32
+ username :
33
+ title :
34
+ other : 用户名
35
+ description :
36
+ other : Redis 用户名
32
37
password :
33
38
title :
34
39
other : 密码
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ type Cache struct {
42
42
43
43
type CacheConfig struct {
44
44
Endpoint string `json:"endpoint"`
45
+ Username string `json:"username"`
45
46
Password string `json:"password"`
46
47
}
47
48
@@ -145,6 +146,17 @@ func (c *Cache) ConfigFields() []plugin.ConfigField {
145
146
},
146
147
Value : c .Config .Endpoint ,
147
148
},
149
+ {
150
+ Name : "username" ,
151
+ Type : plugin .ConfigTypeInput ,
152
+ Title : plugin .MakeTranslator (i18n .ConfigUsernameTitle ),
153
+ Description : plugin .MakeTranslator (i18n .ConfigUsernameDescription ),
154
+ Required : false ,
155
+ UIOptions : plugin.ConfigFieldUIOptions {
156
+ InputType : plugin .InputTypeText ,
157
+ },
158
+ Value : c .Config .Username ,
159
+ },
148
160
{
149
161
Name : "password" ,
150
162
Type : plugin .ConfigTypeInput ,
@@ -166,6 +178,7 @@ func (c *Cache) ConfigReceiver(config []byte) error {
166
178
167
179
c .RedisClient = redis .NewClient (& redis.Options {
168
180
Addr : conf .Endpoint ,
181
+ Username : conf .Username ,
169
182
Password : conf .Password ,
170
183
})
171
184
return nil
You can’t perform that action at this time.
0 commit comments