diff options
| author | alex <[email protected]> | 2026-07-10 20:01:03 +0200 |
|---|---|---|
| committer | alex <[email protected]> | 2026-07-10 20:01:03 +0200 |
| commit | d1628cb76ac4f907d8e57346809e3ac0b8e12de5 (patch) | |
| tree | 5a4612c2899e3c6e9da5ee0e2bdd4ca153015cce /main.go | |
| parent | 8be622b6b482b40f0b26259d6ed613a7d7307d53 (diff) | |
| download | redis-clone-d1628cb76ac4f907d8e57346809e3ac0b8e12de5.tar.xz redis-clone-d1628cb76ac4f907d8e57346809e3ac0b8e12de5.zip | |
base integraion of command-registry system
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 15 |
1 files changed, 1 insertions, 14 deletions
@@ -2,7 +2,6 @@ package main import ( "bufio" - "errors" "fmt" "net" "os" @@ -118,19 +117,7 @@ func handleConnection(conn net.Conn) { command := strings.ToUpper(args[0]) - switch { - case baseCommandRegistry[command] != nil: - handler := baseCommandRegistry[command] - conn.Write(serializeRESP(handler(args))) - - case connectionCommandRegistry[command] != nil: - handler := connectionCommandRegistry[command] - handler(conn, args) - - default: - errMsg := fmt.Sprintf("ERR unknown command '%s'", command) - conn.Write(serializeRESP(errors.New(errMsg))) - } + conn.Write(serializeRESP(DispatchBaseCommand(command,args))) } }
\ No newline at end of file |
