|
|
@@ -29,7 +29,7 @@ var ErrNil = errors.New("redigo: nil returned")
|
|
|
//
|
|
|
// Reply type Result
|
|
|
// integer int(reply), nil
|
|
|
-// bulk parsed reply, nil
|
|
|
+// bulk string parsed reply, nil
|
|
|
// nil 0, ErrNil
|
|
|
// other 0, error
|
|
|
func Int(reply interface{}, err error) (int, error) {
|
|
|
@@ -60,7 +60,7 @@ func Int(reply interface{}, err error) (int, error) {
|
|
|
//
|
|
|
// Reply type Result
|
|
|
// integer reply, nil
|
|
|
-// bulk parsed reply, nil
|
|
|
+// bulk string parsed reply, nil
|
|
|
// nil 0, ErrNil
|
|
|
// other 0, error
|
|
|
func Int64(reply interface{}, err error) (int64, error) {
|
|
|
@@ -86,7 +86,7 @@ func Int64(reply interface{}, err error) (int64, error) {
|
|
|
// the reply to an int as follows:
|
|
|
//
|
|
|
// Reply type Result
|
|
|
-// bulk parsed reply, nil
|
|
|
+// bulk string parsed reply, nil
|
|
|
// nil 0, ErrNil
|
|
|
// other 0, error
|
|
|
func Float64(reply interface{}, err error) (float64, error) {
|
|
|
@@ -110,8 +110,8 @@ func Float64(reply interface{}, err error) (float64, error) {
|
|
|
// reply to a string as follows:
|
|
|
//
|
|
|
// Reply type Result
|
|
|
-// bulk string(reply), nil
|
|
|
-// status reply, nil
|
|
|
+// bulk string string(reply), nil
|
|
|
+// simple string reply, nil
|
|
|
// nil "", ErrNil
|
|
|
// other "", error
|
|
|
func String(reply interface{}, err error) (string, error) {
|
|
|
@@ -136,8 +136,8 @@ func String(reply interface{}, err error) (string, error) {
|
|
|
// the reply to a slice of bytes as follows:
|
|
|
//
|
|
|
// Reply type Result
|
|
|
-// bulk reply, nil
|
|
|
-// status []byte(reply), nil
|
|
|
+// bulk string reply, nil
|
|
|
+// simple string []byte(reply), nil
|
|
|
// nil nil, ErrNil
|
|
|
// other nil, error
|
|
|
func Bytes(reply interface{}, err error) ([]byte, error) {
|
|
|
@@ -163,7 +163,7 @@ func Bytes(reply interface{}, err error) ([]byte, error) {
|
|
|
//
|
|
|
// Reply type Result
|
|
|
// integer value != 0, nil
|
|
|
-// bulk strconv.ParseBool(reply)
|
|
|
+// bulk string strconv.ParseBool(reply)
|
|
|
// nil false, ErrNil
|
|
|
// other false, error
|
|
|
func Bool(reply interface{}, err error) (bool, error) {
|
|
|
@@ -186,12 +186,12 @@ func Bool(reply interface{}, err error) (bool, error) {
|
|
|
// MultiBulk is deprecated. Use Values.
|
|
|
func MultiBulk(reply interface{}, err error) ([]interface{}, error) { return Values(reply, err) }
|
|
|
|
|
|
-// Values is a helper that converts a multi-bulk command reply to a
|
|
|
-// []interface{}. If err is not equal to nil, then Values returns nil, err.
|
|
|
-// Otherwise, Multi converts the reply as follows:
|
|
|
+// Values is a helper that converts an array command reply to a []interface{}.
|
|
|
+// If err is not equal to nil, then Values returns nil, err. Otherwise, Values
|
|
|
+// converts the reply as follows:
|
|
|
//
|
|
|
// Reply type Result
|
|
|
-// multi-bulk reply, nil
|
|
|
+// array reply, nil
|
|
|
// nil nil, ErrNil
|
|
|
// other nil, error
|
|
|
func Values(reply interface{}, err error) ([]interface{}, error) {
|
|
|
@@ -209,9 +209,9 @@ func Values(reply interface{}, err error) ([]interface{}, error) {
|
|
|
return nil, fmt.Errorf("redigo: unexpected type for Values, got type %T", reply)
|
|
|
}
|
|
|
|
|
|
-// Strings is a helper that converts a multi-bulk command reply to a []string.
|
|
|
-// If err is not equal to nil, then Strings returns nil, err. If one if the
|
|
|
-// multi-bulk items is not a bulk value or nil, then Strings returns an error.
|
|
|
+// Strings is a helper that converts an array command reply to a []string. If
|
|
|
+// err is not equal to nil, then Strings returns nil, err. If one if the array
|
|
|
+// items is not a bulk string or nil, then Strings returns an error.
|
|
|
func Strings(reply interface{}, err error) ([]string, error) {
|
|
|
if err != nil {
|
|
|
return nil, err
|