Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rvarago/toy-storage-rs

A toy storage implemented in Rust purely for learning
https://github.com/rvarago/toy-storage-rs

network protocol rust

Last synced: about 15 hours ago
JSON representation

A toy storage implemented in Rust purely for learning

Awesome Lists containing this project

README

        

# A **toy** in-memory storage

This is a toy in-memory storage server with data exchanged over the network.

> DISCLAIMER: This is nothing more than a self-contained **playground** project for having some fun while learning Rust.

## Wire Protocol

This is a request-response protocol over TCP, where the client initiates an exchange by sending a request to the server which then sends a response back to the client.

Messages (request/response) are line-delimited.

### SET

- Request: `SET \n`
- Response: `OKAY \n`

### GET

- Request: `GET \n`
- Response (Success): `OKAY \n`
- Response (Failure): `FAIL \n`

## Example Session

By simulating a client as an `nc` instance:

```bash
λ nc 127.0.0.1 8080
GET rafael
FAIL rafael
SET rafael 123
OKAY rafael
GET rafael
OKAY rafael 123
```