github.com/therealbill/libredis@v0.0.0-20161227004305-7d50abda5ccf/client/connection.go (about) 1 package client 2 3 // Echo command returns message. 4 func (r *Redis) Echo(message string) (string, error) { 5 rp, err := r.ExecuteCommand("ECHO", message) 6 if err != nil { 7 return "", err 8 } 9 return rp.StringValue() 10 } 11 12 // Ping command returns PONG. 13 // This command is often used to test if a connection is still alive, or to measure latency. 14 func (r *Redis) Ping() error { 15 _, err := r.ExecuteCommand("PING") 16 return err 17 } 18 19 func (r *Redis) Address() string { 20 return r.address 21 }