Documentation ¶
Index ¶
- Constants
- Variables
- func Array(args ...string) string
- func Error(s string) string
- func Float(n float64) string
- func Inline(s string) string
- func Int(n int) string
- func Ints(args ...int) string
- func IsError(s string) bool
- func Map(args ...string) string
- func Parse(b string) (interface{}, error)
- func Push(args ...string) string
- func Read(r *bufio.Reader) (string, error)
- func ReadArray(b string) ([]string, error)
- func ReadError(b string) (string, error)
- func ReadString(b string) (string, error)
- func ReadStrings(b string) ([]string, error)
- func Set(args ...string) string
- func String(s string) string
- func StringMap(args ...string) string
- func StringSet(args ...string) string
- func Strings(args ...string) string
- func Write(w io.Writer, cmd []string) error
- type Client
Constants ¶
const ( Nil = "$-1\r\n" NilList = "*-1\r\n" NilList2 = "*0\r\n" )
Variables ¶
var ( ErrProtocol = errors.New("unsupported protocol") ErrUnexpected = errors.New("not what you asked for") )
Functions ¶
func Array ¶
Array assembles the args in a list. Args should be raw redis commands. Example: Array(String("foo"), String("bar"))
func Map ¶
Map assembles the args in a map. Args should be raw redis commands. Must be an even number of arguments. Example: Map(String("foo"), String("bar"))
func Parse ¶
Parse into interfaces. `b` must contain exactly a single command (which can be nested).
func Push ¶
Push assembles the args for push-data. Args should be raw redis commands. Example: Push(String("foo"), String("bar"))
func Read ¶
Read a single command, returning it raw. Used to read replies from redis. Understands RESP3 proto.
func ReadArray ¶
Read an array, with all elements are the raw redis commands Also reads sets and maps.
func ReadString ¶
func ReadStrings ¶
func Set ¶
Set assembles the args in a map. Args should be raw redis commands. Example: Set(String("foo"), String("bar"))