|
|
@@ -121,4 +121,18 @@
|
|
|
// case error:
|
|
|
// return v
|
|
|
// }
|
|
|
+//
|
|
|
+// Reply Helpers
|
|
|
+//
|
|
|
+// The Bool, Int, Bytes, String and MultiBulk functions convert a reply to a
|
|
|
+// value of a specific type. To allow convenient wrapping of calls to the
|
|
|
+// connection Do and Receive methods, the functions take a second argument of
|
|
|
+// type error. If the error is non-nil, then the helper function returns the
|
|
|
+// error. If the error is nil, the function converts the reply to the specified
|
|
|
+// type:
|
|
|
+//
|
|
|
+// exists, err := redis.Bool(c.Do("EXISTS", "foo"))
|
|
|
+// if err != nil {
|
|
|
+// // handle error return from c.Do or type conversion error.
|
|
|
+// }
|
|
|
package redis
|