func (v Value) Bool() bool {
	return v.Integer() != 0
}
Bool converts Value to an bool. If Value cannot be converted, false is returned.
package resp
import (
	"bufio"
	"bytes"
	"errors"
	"fmt"
	"io"
	"strconv"
)
const bufsz = 4096
type Type byte
const (
	SimpleString Type = '+'
	Error        Type = '-'
	Integer      Type = ':'
	BulkString   Type = '$'
	Array        Type = '*'
)
func (t Type) String() string {
	switch t {
	default:
		return "Unknown"
	case '+':
		return "SimpleString"
	case '-':
		return "Error"
	case ':':
		return "Integer"
	case '$':
		return "BulkString"
	case '*':
		return "Array"
	}
}
type Value struct {
	typ     Type
	integer int
	str     []byte
	array   []Value
	null    bool
}
func (v Value) Integer() int {
	switch v.typ {
	default:
		n, _ := strconv.ParseInt(v.String(), 10, 64)
		return int(n)
	case ':':
		return v.integer
	}
}
func (v Value) String() string {
	if v.typ == '$' {
		return string(v.str)
	}
	switch v.typ {
	case '+', '-':
		return string(v.str)
	case ':':
		return strconv.FormatInt(int64(v.integer), 10)
	case '*':
		return fmt.Sprintf("%v", v.array)
	}
	return ""
}
func (v Value) Bytes() []byte {
	switch v.typ {
	default:
		return []byte(v.String())
	case '$', '+', '-':
		return v.str
	}
}
func (v Value) Float() float64 {
	switch v.typ {
	default:
		f, _ := strconv.ParseFloat(v.String(), 64)
		return f
	case ':':
		return float64(v.integer)
	}
}
func (v Value) IsNull() bool {
	return v.null
}