Giter Site home page Giter Site logo

tiny-redis's Introduction

tiny-redis

tiny-redis intends to be a rough implementation of the in-memory data store: Redis.

Note:

  • The parser implements a subset of RESP3 without the Attribute, Push and Streamed data types.
  • The project itself implements a subset of commands as specified in redis-doc.

Getting Started

Pre-requisites

Running locally

make run

Note: The examples assume that the TCP server is running on localhost at port 8001.

Usage

You can run commands through netcat following the Redis protocol:

echo -e '*1\r\n$4\r\nPING\r\n' | nc localhost 8001

Or you can start a redis client using the redis-cli: redis-cli -p 8001 and then use it in Interactive mode.

127.0.0.1:8001> SET hello 3
OK

Creating a build

make build

Running tests

make test

Author

Acknowledgements

LICENSE

  • License for tiny-redis: MIT
  • The Redis trademark is owned by Redis Labs.

Appendix

A. List of Allowed Commands

  • Connection: PING, ECHO
  • Keys: DEL, EXISTS, COPY [REPLACE]
  • Strings: GET, SET [NX|XX] [GET], GETDEL, INCR, DECR, INCRBY, DECRBY, APPEND, GETRANGE, STRLEN, SETRANGE, MGET, MSET, MSETNX, GETBIT
  • Server: SAVE

Note: Some commands may not support all options available in Redis 6. All available options have been documented above.

B. Allowed Configuration Parameters

Flag Explanation Default Value
port TCP Port 8001
bind IP or Hostname [::]

Note: Currently, configuration is only supported through command line flags. Eg: go run server.go -p 6379

tiny-redis's People

Contributors

tinfoil-knight avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.