refactor project structure

This commit is contained in:
hdt3213
2021-05-02 14:54:42 +08:00
parent bb9c140653
commit f29298cc68
78 changed files with 140 additions and 140 deletions

17
db/server.go Normal file
View 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")
}
}