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

Function ExampleConn_client_setInfo_libraryVersion

example_test.go:178–198  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

176}
177
178func ExampleConn_client_setInfo_libraryVersion() {
179 conn := rdb.Conn()
180
181 err := conn.ClientSetInfo(ctx, redis.WithLibraryVersion("1.2.3")).Err()
182 if err != nil {
183 panic(err)
184 }
185
186 // Open other connections.
187 for i := 0; i < 10; i++ {
188 go rdb.Ping(ctx)
189 }
190
191 s, err := conn.ClientInfo(ctx).Result()
192 if err != nil {
193 panic(err)
194 }
195
196 fmt.Println(s.LibVer)
197 // Output: 1.2.3
198}
199
200func ExampleClient_Set() {
201 // Last argument is expiration. Zero means the key has no

Callers

nothing calls this directly

Calls 6

ConnMethod · 0.80
ErrMethod · 0.65
ClientSetInfoMethod · 0.65
PingMethod · 0.65
ResultMethod · 0.65
ClientInfoMethod · 0.65

Tested by

no test coverage detected