github.com/zhongdalu/gf@v1.0.0/g/database/gredis/gredis_conn.go (about)

     1  // Copyright 2019 gf Author(https://github.com/zhongdalu/gf). All Rights Reserved.
     2  //
     3  // This Source Code Form is subject to the terms of the MIT License.
     4  // If a copy of the MIT was not distributed with this file,
     5  // You can obtain one at https://github.com/zhongdalu/gf.
     6  
     7  package gredis
     8  
     9  import "github.com/zhongdalu/gf/g/container/gvar"
    10  
    11  // DoVar returns value from Do as gvar.Var.
    12  func (c *Conn) DoVar(command string, args ...interface{}) (*gvar.Var, error) {
    13  	v, err := c.Do(command, args...)
    14  	return gvar.New(v, true), err
    15  }
    16  
    17  // ReceiveVar receives a single reply as gvar.Var from the Redis server.
    18  func (c *Conn) ReceiveVar() (*gvar.Var, error) {
    19  	v, err := c.Receive()
    20  	return gvar.New(v, true), err
    21  }