Documentation ¶
Index ¶
- Variables
- func Bool(data interface{}, err error) (bool, error)
- func Float64(data interface{}, err error) (float64, error)
- func Int(data interface{}, err error) (int, error)
- func Int64(data interface{}, err error) (int64, error)
- func String(data interface{}, err error) (string, error)
- func Strings(data interface{}, err error) ([]string, error)
- type Error
Constants ¶
This section is empty.
Variables ¶
var ErrNil = errors.New("nil returned")
ErrNil indicates that a data value is nil.
Functions ¶
func Bool ¶
Bool is a helper that converts a command data to a boolean. If err is not equal to nil, then Bool returns false, err. Otherwise Bool converts the data to boolean as follows:
Reply type Result integer value != 0, nil bulk string strconv.ParseBool(data) nil false, ErrNil other false, error
func Float64 ¶
Float64 is a helper that converts a command data to 64 bit float. If err is not equal to nil, then Float64 returns 0, err. Otherwise, Float64 converts the data to an int as follows:
Reply type Result bulk string parsed data, nil nil 0, ErrNil other 0, error
func Int ¶
Int is a helper that converts a command data to an integer. If err is not equal to nil, then Int returns 0, err. Otherwise, Int converts the data to an int as follows:
Reply type Result integer int(data), nil bulk string parsed data, nil nil 0, ErrNil other 0, error
func Int64 ¶
Int64 is a helper that converts a command data to 64 bit integer. If err is not equal to nil, then Int returns 0, err. Otherwise, Int64 converts the data to an int64 as follows:
Reply type Result integer data, nil bulk string parsed data, nil nil 0, ErrNil other 0, error
func String ¶
String is a helper that converts a command data to a string. If err is not equal to nil, then String returns "", err. Otherwise String converts the data to a string as follows:
Reply type Result bulk string string(data), nil simple string data, nil nil "", ErrNil other "", error