Documentation ¶
Overview ¶
Package util is a collection of helper functions for interacting with various parts of the radix.v2 package
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Scan ¶
Scan is a helper function for performing any of the redis *SCAN functions. It takes in a channel which keys returned by redis will be written to, and returns an error should any occur. The input channel will always be closed when Scan returns, and *must* be read until it is closed.
The key argument is only needed if cmd isn't SCAN
Example SCAN command
ch := make(chan string) var err error go func() { err = util.Scan(r, ch, "SCAN", "", "*") }() for key := range ch { // do something with key } if err != nil { // handle error }
Example HSCAN command
ch := make(chan string) var err error go func() { err = util.Scan(r, ch, "HSCAN", "somekey", "*") }() for key := range ch { // do something with key } if err != nil { // handle error }
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.