Commit Graph

6 Commits

Author SHA1 Message Date
Vladimir Mihailenco b358584bd3 Fix build 2021-02-04 09:34:10 +02:00
Vladimir Mihailenco bd234b91fe Add StructValue so we don't need temp slices to pass keys and values 2021-02-03 12:45:02 +02:00
Kailash Nadh a4144ea98e Add SliceCmd.Scan() (hscan pkg) and tests 2021-02-02 13:04:52 +05:30
Vladimir Mihailenco 380ab17274 Fix cleanup 2021-01-29 12:12:47 +02:00
Vladimir Mihailenco 8926f2992a Cleanup 2021-01-29 12:04:39 +02:00
Kailash Nadh 6f96bebac7 Add redis.Scan() to scan results from redis maps into structs.
The package uses reflection to decode default types (int, string
etc.) from Redis map results (key-value pair sequences) into
struct fields where the fields are matched to Redis keys by tags.

Similar to how `encoding/json` allows custom decoders using
`UnmarshalJSON()`, the package supports decoding of arbitrary
types into struct fields by defining a `Decode(string) error`
function on types.

The field/type spec of every struct that's passed to Scan() is
cached in the package so that subsequent scans avoid iteration
and reflection of the struct's fields.
2021-01-28 18:04:38 +05:30