flushAllFromAddr send the flush_all command to the given addr
(addr net.Addr)
| 397 | |
| 398 | // flushAllFromAddr send the flush_all command to the given addr |
| 399 | func (c *Client) flushAllFromAddr(addr net.Addr) error { |
| 400 | return c.withAddrRw(addr, func(conn *conn) error { |
| 401 | rw := conn.rw |
| 402 | if _, err := fmt.Fprintf(rw, "flush_all\r\n"); err != nil { |
| 403 | return err |
| 404 | } |
| 405 | if err := rw.Flush(); err != nil { |
| 406 | return err |
| 407 | } |
| 408 | line, err := rw.ReadSlice('\n') |
| 409 | if err != nil { |
| 410 | return err |
| 411 | } |
| 412 | switch { |
| 413 | case bytes.Equal(line, resultOk): |
| 414 | break |
| 415 | default: |
| 416 | return fmt.Errorf("memcache: unexpected response line from flush_all: %q", string(line)) |
| 417 | } |
| 418 | return nil |
| 419 | }) |
| 420 | } |
| 421 | |
| 422 | // ping sends the version command to the given addr |
| 423 | func (c *Client) ping(addr net.Addr) error { |
nothing calls this directly
no test coverage detected