mirror of
https://github.com/alibaba/higress.git
synced 2026-03-15 14:20:46 +08:00
add redis init status log (#1867)
Co-authored-by: Kent Dong <ch3cho@qq.com>
This commit is contained in:
@@ -30,6 +30,8 @@ type RedisResponseCallback func(response resp.Value)
|
||||
|
||||
type RedisClient interface {
|
||||
Init(username, password string, timeout int64, opts ...optionFunc) error
|
||||
// return whether redis client is ready
|
||||
Ready() bool
|
||||
// with this function, you can call redis as if you are using redis-cli
|
||||
Command(cmds []interface{}, callback RedisResponseCallback) error
|
||||
Eval(script string, numkeys int, keys, args []interface{}, callback RedisResponseCallback) error
|
||||
@@ -183,6 +185,10 @@ func respString(args []interface{}) []byte {
|
||||
return buf.Bytes()
|
||||
}
|
||||
|
||||
func (c *RedisClusterClient[C]) Ready() bool {
|
||||
return c.ready
|
||||
}
|
||||
|
||||
func (c *RedisClusterClient[C]) Init(username, password string, timeout int64, opts ...optionFunc) error {
|
||||
for _, opt := range opts {
|
||||
opt(&c.option)
|
||||
|
||||
Reference in New Issue
Block a user