ClientSetName assigns a namee to the PubSub connection using CLIENT SETNAME, The name is visible in CLIENT LIST output and is useful for debugging and identifying connections in a redis instance.
(ctx context.Context, name string)
| 366 | // The name is visible in CLIENT LIST output and is useful for debugging |
| 367 | // and identifying connections in a redis instance. |
| 368 | func (c *PubSub) ClientSetName(ctx context.Context, name string) error { |
| 369 | cmd := NewStatusCmd(ctx, "client", "setname", name) |
| 370 | |
| 371 | c.mu.Lock() |
| 372 | defer c.mu.Unlock() |
| 373 | |
| 374 | cn, err := c.conn(ctx, nil) |
| 375 | if err != nil { |
| 376 | return err |
| 377 | } |
| 378 | |
| 379 | err = c.writeCmd(ctx, cn, cmd) |
| 380 | c.releaseConn(ctx, cn, err, false) |
| 381 | return err |
| 382 | } |
| 383 | |
| 384 | // Subscription received after a successful subscription to channel. |
| 385 | type Subscription struct { |
nothing calls this directly
no test coverage detected