Add stub database selection, and fix differences between pekoe and c-redis

- PUBSUB CHANNELS glob pattern matching
- Implement SELECT + max DB validation (0-15) (default db max is 16), for perl clients
- CLIENT KILL ID (single/range) + MAXAGE
- CLIENT INFO events + resp fields
- PUBSUB SHARDCHANNELS/SHARDNUMSUB stubs
This commit is contained in:
eleksir
2026-04-03 01:02:03 +03:00
parent 9e30243533
commit 92cd652b0d
5 changed files with 266 additions and 10 deletions

View File

@@ -21,6 +21,8 @@ import (
"github.com/eleksir/pekoe/internal/pubsub"
)
const MaxDatabases = 16 // Redis default maximum databases (0-15)
// Sentinel errors for connection handling
var (
ErrQuit = errors.New("client quit")
@@ -276,6 +278,8 @@ func (s *Server) processCommand(client *pubsub.Client, cmd *Command, writer *Con
return s.handleQuit(client, writer)
case "client":
return s.handleClient(client, cmd.Args[1:], writer)
case "select":
return s.handleSelect(client, cmd.Args[1:], writer)
default:
// Check if client is in pubsub mode - only pubsub commands allowed
if client != nil && (client.SubsCount() > 0 || client.PatternSubsCount() > 0) {