Skip to content

Latest commit

 

History

History
80 lines (52 loc) · 1.2 KB

README.md

File metadata and controls

80 lines (52 loc) · 1.2 KB

redis

redis is an application and library implementing redis protocol in Erlang.

Build Status

Usage

rebar3 shell

Serializer

Encoding Erlang terms in Redis data format using redis:encode/1 function:

% 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:

% 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

rebar3 eunit

Resources and References

About

Made with <3 by Mathieu Kerjouan with Erlang and rebar3.