2019-05-14 21:34:38 +08:00
|
|
|
// Copyright 2019 gf Author(https://github.com/gogf/gf). All Rights Reserved.
|
|
|
|
//
|
|
|
|
// This Source Code Form is subject to the terms of the MIT License.
|
|
|
|
// If a copy of the MIT was not distributed with this file,
|
|
|
|
// You can obtain one at https://github.com/gogf/gf.
|
|
|
|
|
|
|
|
package gredis
|
|
|
|
|
2019-07-29 21:01:19 +08:00
|
|
|
import "github.com/gogf/gf/container/gvar"
|
2019-05-14 21:34:38 +08:00
|
|
|
|
|
|
|
// DoVar returns value from Do as gvar.Var.
|
|
|
|
func (c *Conn) DoVar(command string, args ...interface{}) (*gvar.Var, error) {
|
|
|
|
v, err := c.Do(command, args...)
|
2019-07-23 23:20:27 +08:00
|
|
|
return gvar.New(v), err
|
2019-05-14 21:34:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// ReceiveVar receives a single reply as gvar.Var from the Redis server.
|
|
|
|
func (c *Conn) ReceiveVar() (*gvar.Var, error) {
|
|
|
|
v, err := c.Receive()
|
2019-07-23 23:20:27 +08:00
|
|
|
return gvar.New(v), err
|
2019-06-19 09:06:52 +08:00
|
|
|
}
|