The following tips should help you write great stage instructions for your challenge.
In this stage, you’ll add support for theTYPE
command.The TYPE command
The TYPE command returns the type of value stored at a given key. It returns one of the following types: string, list, set, zset, hash, and stream. Here’s how it works:If a key doesn’t exist, the return value will be “none”.The return value is encoded as a simple string.Tests
The tester will execute your program like this:It’ll then send aSET
command to your server.It’ll then send aTYPE
command to your server.Your server should respond with+string\r\n
, which isstring
encoded as a RESP simple string. It’ll then send anotherTYPE
command with a missing key.Your server should respond with+none\r\n
, which isnone
encoded as a RESP simple string.Notes
- For now, you only need to handle the “string” and “none” types. We’ll add support for the “stream” type in the next stage.