mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-05 16:57:06 +08:00
18 lines
394 B
Go
18 lines
394 B
Go
package db
|
|
|
|
import (
|
|
"github.com/hdt3213/godis/interface/redis"
|
|
"github.com/hdt3213/godis/redis/reply"
|
|
)
|
|
|
|
// Ping the server
|
|
func Ping(db *DB, args [][]byte) redis.Reply {
|
|
if len(args) == 0 {
|
|
return &reply.PongReply{}
|
|
} else if len(args) == 1 {
|
|
return reply.MakeStatusReply(string(args[0]))
|
|
} else {
|
|
return reply.MakeErrReply("ERR wrong number of arguments for 'ping' command")
|
|
}
|
|
}
|