Files
redis-go/src/db/server.go
2019-08-03 17:42:13 +08:00

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")
}
}