()
| 220 | } |
| 221 | |
| 222 | func ExampleClient_HSet() { |
| 223 | // Set "redis" tag for hash key |
| 224 | type ExampleUser struct { |
| 225 | Name string `redis:"name"` |
| 226 | Age int `redis:"age"` |
| 227 | } |
| 228 | |
| 229 | items := ExampleUser{"jane", 22} |
| 230 | |
| 231 | err := rdb.HSet(ctx, "user:1", items).Err() |
| 232 | if err != nil { |
| 233 | panic(err) |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | func ExampleClient_Incr() { |
| 238 | result, err := rdb.Incr(ctx, "counter").Result() |