mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-14 13:03:40 +08:00
16 lines
431 B
Go
16 lines
431 B
Go
package db
|
|
|
|
import (
|
|
"github.com/HDT3213/godis/src/interface/redis"
|
|
"github.com/HDT3213/godis/src/redis/reply"
|
|
)
|
|
|
|
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")
|
|
}
|
|
} |