mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-05 08:46:56 +08:00
Add info command (#141)
* Generate a new runid for each start of godis * Add info command * Add info command * Generate a new runid for each start of godis * Add unittests for the info command
This commit is contained in:
@@ -17,6 +17,8 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
var godisVersion = "1.2.8" // do not modify
|
||||
|
||||
// Server is a redis-server with full capabilities including multiple database, rdb loader, replication
|
||||
type Server struct {
|
||||
dbSet []*atomic.Value // *DB
|
||||
@@ -90,6 +92,10 @@ func (server *Server) Exec(c redis.Connection, cmdLine [][]byte) (result redis.R
|
||||
if cmdName == "auth" {
|
||||
return Auth(c, cmdLine[1:])
|
||||
}
|
||||
// info
|
||||
if cmdName == "info" {
|
||||
return Info(c, cmdLine)
|
||||
}
|
||||
if !isAuthenticated(c) {
|
||||
return protocol.MakeErrReply("NOAUTH Authentication required")
|
||||
}
|
||||
|
Reference in New Issue
Block a user