MCPcopy
hub / github.com/redis/go-redis / ExampleClient_HSet

Function ExampleClient_HSet

example_test.go:222–235  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

220}
221
222func 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
237func ExampleClient_Incr() {
238 result, err := rdb.Incr(ctx, "counter").Result()

Callers

nothing calls this directly

Calls 2

ErrMethod · 0.65
HSetMethod · 0.65

Tested by

no test coverage detected