Skip to content

KrySeyt/myredis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MyRedis

My simple Redis data structure store powered by myasync. RESP2 compatible. Supports redis-cli.

Implemented:

  • Replicas
  • Append-only snapshots
  • Ping
  • Echo
  • Get
  • Set (with expire)
  • Get config values

Setup

  • Create venv
python -m venv .venv 
  • Activate venv
. .venv/bin/activate 
  • Install myredis
pip install myredis@git+https://github.com/KrySeyt/myredis.git
  • Run myredis server
python -m myredis

Configuration

  • --port <port:int> - Optional. Server port. Default - 6379
  • --dir <dirname:str> - Optional. DB files dir.
  • --dbfilename <filename:str> - Optional. DB filename.
  • --snapshotsinterval <seconds:int> - Optional. Interval between snapshot updates. Default - 300 secs (5 mins)
  • --replicaof <master-domain:str> <master-port:int> - Optional. Start server as replica of master
python -m myredis --port 6379 --dir mydir --dbfilename dbfile

Supported commands

redis-cli get foo
redis-cli set foo bar
redis-cli set foo bar px 1000
redis-cli wait 3 1000
redis-cli ping
redis-cli echo "Hello, World\!"
redis-cli wait 3 1000
redis-cli config get port

Supported data types

  • String
  • Integer (server responses only)
  • Null (server responses only)

Tests

  • Complete Setup

  • Run tests

pytest

About

My simple Redis powered by MyAsync

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages