Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/niamtokik/redis
Redis Protocol Erlang Implementation
https://github.com/niamtokik/redis
client erlang redis serialization serializer server
Last synced: about 3 hours ago
JSON representation
Redis Protocol Erlang Implementation
- Host: GitHub
- URL: https://github.com/niamtokik/redis
- Owner: niamtokik
- License: isc
- Created: 2021-03-19T17:05:19.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-04-19T19:38:28.000Z (over 3 years ago)
- Last Synced: 2023-07-14T13:29:38.662Z (over 1 year ago)
- Topics: client, erlang, redis, serialization, serializer, server
- Language: Erlang
- Homepage:
- Size: 10.7 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# redis
`redis` is an application and library implementing redis protocol in
Erlang.[![Build Status][gh badge]][gh]
## Usage
```sh
rebar3 shell
```### Serializer
Encoding Erlang terms in Redis data format using `redis:encode/1`
function:```erlang
% integer
redis:encode(1).% simple string
redis:encode(<<"test">>).% bulk string
redis:encode({bulk_string, <<"test">>).% array
redis:encode([1,2,3,<<"test">>, {bulk_string, <<"test">>}]).% error
redis:encode({error, <<"my message">>}).
```Decoding Redis data in Erlang term with `redis:decode/1` function:
```erlang
% simple string
redis:decode(<<"+OK\r\n">>).% integer
redis:decode(<<":1\r\n">>).% bulk string
redis:decode(<<"$3\r\nfoo\r\n">>).% array
redis:decode(<<"*0\r\n\r\n">>).% error
redis:decode(<<"-Message\r\n">>).
```### Client
wip.
### Server
wip.
## Test
```sh
rebar3 eunit
```# Resources and References
* https://redis.io/topics/protocol
# About
Made with <3 by Mathieu Kerjouan with [Erlang](erlang.org/) and
[rebar3](https://www.rebar3.org).[gh]: https://github.com/niamtokik/redis/actions/workflows/main.yml
[gh badge]: https://img.shields.io/github/workflow/status/niamtokik/redis/CI?style=flat-square