Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/catwell/fakeredis
A Redis mock for Lua with the same interface as redis-lua.
https://github.com/catwell/fakeredis
lua redis
Last synced: about 1 month ago
JSON representation
A Redis mock for Lua with the same interface as redis-lua.
- Host: GitHub
- URL: https://github.com/catwell/fakeredis
- Owner: catwell
- License: mit
- Created: 2013-01-19T12:41:41.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2023-01-11T17:15:00.000Z (almost 2 years ago)
- Last Synced: 2023-03-11T15:34:44.582Z (over 1 year ago)
- Topics: lua, redis
- Language: Lua
- Size: 85.9 KB
- Stars: 17
- Watchers: 5
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# fakeredis
![CI Status](https://github.com/catwell/fakeredis/actions/workflows/ci.yml/badge.svg?branch=master)
## Presentation
fakeredis is a Redis mock for Lua with the same interface as [redis-lua](https://github.com/nrk/redis-lua).
## Dependencies
Lua 5.1 users will need [Lua BitOp](http://bitop.luajit.org/).
If you do not set a custom sleep function and LuaSocket is not installed,
a busy wait will be used for `sleep()`.Tests require [cwtest](https://github.com/catwell/cwtest).
## Usage
```lua
local R = fakeredis.new()
R:set("foo", "bar")
local foo = R:get("bar")
```See [redis-lua](https://github.com/nrk/redis-lua) for more.
## Design
fakeredis tries to keep its interface compatible with redis-lua but is not fully complete, see supported.txt for supported commands.
fakeredis does not support multiple DBs. You should probably not use them anyway. If you really need SELECT in tests it is easy to write a small wrapper that uses multiple instances of fakeredis.
## Copyright
Copyright (c) 2012-2022 Pierre Chapuis