This is a simple implementation of a Redis server in Go. It supports basic commands such as PING
, ECHO
, SET
, and GET
, along with the ability to set key expiry using the PX
argument to the SET
command.
This project was done as a part of CodeCrafters Build Your Own Redis Challenge.
- Go (Golang) installed on your machine
- Basic knowledge of the Redis protocol (RESP)
-
Clone the repository:
git clone https://github.com/BenMeehan/Redis-clone.git
-
Navigate to the project directory:
cd Redis-clone
-
Build the executable:
go build
-
Run the server:
./server
-
Connect to the server using a Redis client (e.g.,
redis-cli
) and start issuing commands:redis-cli
Example commands:
set mykey myvalue px 1000 get mykey
PING
: Responds withPONG
to indicate that the server is running.ECHO
: Echoes back the provided argument.SET
: Sets a key to a value. Supports optional expiry using thePX
argument.GET
: Retrieves the value of a key. Handles key expiry automatically.
This project is licensed under the MIT License. See the LICENSE file for details.