Skip to content

Commit

Permalink
added more samples for the redis2_query directive.
Browse files Browse the repository at this point in the history
  • Loading branch information
agentzh committed Dec 21, 2010
1 parent c416fc3 commit d16886c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README
Expand Up @@ -16,6 +16,21 @@ SYNOPSIS
redis2_pass 127.0.0.1:6379;
}

# GET /get?key=some_key
location /get {
set_unescape_uri $key $arg_key; # this requires ngx_set_misc
redis2_query get $key;
redis2_pass foo.com:6379;
}

# GET /set?key=one&val=first%20value
location /set {
set_unescape_uri $key $arg_key; # this requires ngx_set_misc
set_unescape_uri $val $arg_val; # this requires ngx_set_misc
redis2_query set $key $val;
redis2_pass foo.com:6379;
}

location /bar {
# $ is not special here...
redis2_literal_raw_query '*1\r\n$4\r\nping\r\n';
Expand Down Expand Up @@ -241,6 +256,7 @@ Source Repository

TODO
* Add the "redis2_as_json" directive to allow emitting JSON directly.
* Add full support for redis pipelining in the response parser.

AUTHORS
Yichun "agentzh" Zhang (章亦春) < agentzh@gmail.com >
Expand Down

0 comments on commit d16886c

Please sign in to comment.