A simple implementation of a memcached server written in Go. This server supports basic caching operations such as set, get, add, replace, append, and prepend.
- Basic Caching Operations: set, get, add, replace, append, prepend
- Concurrent Connections: Handles multiple client connections
- Configurable Port: Specify the port for the server to listen on
- Go 1.20 or higher
- Clone the Repository
git clone <repository-url>
cd <repository-directory>Start the server by executing:
go run cmd/server/main.goBy default, the server will listen on port 11211. You can specify a different port using the -port flag:
go run cmd/server/main.go -port 12345To set a value:
echo -e "set mykey 0 3600 9\r\value\r\n" | nc localhost 11211To get the value:
echo -e "get mykey\r\n" | nc localhost 11211