Blueis is a lightweight TCP server that listens on port 7171 and supports basic commands like PING, SET, and GET. It uses an append-only file (AOF) for persistence.
- PING Command: Responds with
PONGor a custom message. - SET Command: Stores a key-value pair in memory.
- GET Command: Retrieves the value for a given key.
- Persistence: Uses an AOF file (
database.aof) to persist data.
blueis/
├── blueis-sdk/ # SDK for interacting with the Blueis server
│ └── blueis-sdk.go # SDK implementation
├── server/ # Contains the Go source files
│ ├── main.go # Entry point of the application
│ ├── aof.go # Handles append-only file persistence
│ ├── resp.go # RESP protocol implementation
│ ├── handler.go # Command handlers (PING, SET, GET)
├── Dockerfile # Dockerfile for building and running the application
├── README.md # Project documentation
└── go.mod # Go module file
- Go: Version 1.18 or higher
- Docker: Installed and configured
-
Clone the repository:
git clone <repository-url> cd blueis
-
Build and run the application:
go run server/main.go
-
Build the Docker image:
docker build -t blueis . -
Run the Docker container:
docker pull pjk010/blueis:latest
You can interact with the server using a TCP client like netcat or a custom client.
-
PING:
nc localhost 7171 *1 $4 PING
Response:
+PONG -
SET:
nc localhost 7171 *3 $3 SET $3 key $5 value
Response:
+OK -
GET:
nc localhost 7171 *2 $3 GET $3 key
Response:
$5 value
This project is licensed under the MIT License.