ots/vendor/github.com/xuyu/goredis/connection.go
Knut Ahlers 5e3d84df9b
Vendor dependencies
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2017-08-03 20:07:30 +02:00

18 lines
420 B
Go

package goredis
// Echo command returns message.
func (r *Redis) Echo(message string) (string, error) {
rp, err := r.ExecuteCommand("ECHO", message)
if err != nil {
return "", err
}
return rp.StringValue()
}
// Ping command returns PONG.
// This command is often used to test if a connection is still alive, or to measure latency.
func (r *Redis) Ping() error {
_, err := r.ExecuteCommand("PING")
return err
}