Hash is the most commonly used Redis type after strings and lists. Needed for the messenger project (user sessions, metadata storage).
Commands
HSET <key> <field> <value> [field value ...]
HGET <key> <field>
HGETALL <key>
HDEL <key> <field> [field ...]
HEXISTS <key> <field>
HLEN <key>
Implementation
- New
TypeHash DataType = "hash" in store
- Store value as
map[string]string
- New
internal/commands/hash.go for handlers
- Tests in
internal/store/store_test.go
Hash is the most commonly used Redis type after strings and lists. Needed for the messenger project (user sessions, metadata storage).
Commands
HSET <key> <field> <value> [field value ...]HGET <key> <field>HGETALL <key>HDEL <key> <field> [field ...]HEXISTS <key> <field>HLEN <key>Implementation
TypeHash DataType = "hash"in storemap[string]stringinternal/commands/hash.gofor handlersinternal/store/store_test.go