mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-12 20:20:16 +08:00
refactor project structure
This commit is contained in:
17
db/server.go
Normal file
17
db/server.go
Normal file
@@ -0,0 +1,17 @@
|
||||
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")
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user