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

Function ExampleConn_name

example_test.go:157–176  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

155}
156
157func ExampleConn_name() {
158 conn := rdb.Conn()
159
160 err := conn.ClientSetName(ctx, "foobar").Err()
161 if err != nil {
162 panic(err)
163 }
164
165 // Open other connections.
166 for i := 0; i < 10; i++ {
167 go rdb.Ping(ctx)
168 }
169
170 s, err := conn.ClientGetName(ctx).Result()
171 if err != nil {
172 panic(err)
173 }
174 fmt.Println(s)
175 // Output: foobar
176}
177
178func ExampleConn_client_setInfo_libraryVersion() {
179 conn := rdb.Conn()

Callers

nothing calls this directly

Calls 6

ConnMethod · 0.80
ErrMethod · 0.65
ClientSetNameMethod · 0.65
PingMethod · 0.65
ResultMethod · 0.65
ClientGetNameMethod · 0.65

Tested by

no test coverage detected