MCPcopy
hub / github.com/bradfitz/gomemcache / flushAllFromAddr

Method flushAllFromAddr

memcache/memcache.go:399–420  ·  view source on GitHub ↗

flushAllFromAddr send the flush_all command to the given addr

(addr net.Addr)

Source from the content-addressed store, hash-verified

397
398// flushAllFromAddr send the flush_all command to the given addr
399func (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
423func (c *Client) ping(addr net.Addr) error {

Callers

nothing calls this directly

Calls 1

withAddrRwMethod · 0.95

Tested by

no test coverage detected