Documentation ¶
Overview ¶
Package resphelper provides a number of methods for working with radix.v2 Resp structs
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnmarshalResp ¶
UnmarshalResp takes a *redis.Resp and attemps to unmarshal its data into the given struct or pointer to a struct.
Struct fields must be of types string, []byte, int, or int64. Embedded structs and pointers to structs are also allowed
A struct field can tag itself using "resp" in order to change the name of the key it will look at when filling itself in.
type Foo struct { A string B int `resp: "bb"` } r := conn.Cmd("HGETALL", "foo") // retrieve resp f := Foo{} if err := resphelper.UnmarshalResp(r, &f); err != nil { // handle error }
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.