Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
1259672f
Commit
1259672f
authored
Nov 03, 2009
by
antirez
Browse files
client libs removed from Redis git
parent
5762b7f0
Changes
110
Hide whitespace changes
Inline
Side-by-side
client-libraries/scala/src/test/scala/com/redis/operations/SortOperationsSpec.scala
deleted
100644 → 0
View file @
5762b7f0
import
org.specs._
import
com.redis._
import
org.specs.mock.Mockito
import
org.mockito.Mock._
import
org.mockito.Mockito._
object
SortOperationsSpec
extends
Specification
with
Mockito
{
"Redis Client Sort Operations"
should
{
var
client
:
RedisTestClient
=
null
var
connection
:
Connection
=
null
doBefore
{
connection
=
mock
[
Connection
]
client
=
new
RedisTestClient
(
connection
)
}
"sort the contents of the specified key"
in
{
val
listResult
:
List
[
String
]
=
List
(
"one"
,
"two"
,
"three"
)
connection
.
readList
returns
listResult
client
.
sort
(
"set"
,
"ALPHA DESC"
)
mustEqual
listResult
connection
.
write
(
"SORT set ALPHA DESC\r\n"
)
was
called
}
"sort the contents of the specified key with default"
in
{
val
listResult
:
List
[
String
]
=
List
(
"one"
,
"two"
,
"three"
)
connection
.
readList
returns
listResult
client
.
sort
(
"set"
)
mustEqual
listResult
connection
.
write
(
"SORT set\r\n"
)
was
called
}
}
}
client-libraries/tcl/redis.tcl
deleted
100644 → 0
View file @
5762b7f0
# Tcl clinet library - used by test-redis.tcl script for now
# Copyright
(
C
)
2009 Salvatore Sanfilippo
# Released under the BSD license like Redis itself
#
# Example usage:
#
# set r
[
redis 127.0.0.1 6379
]
# $r lpush mylist foo
# $r lpush mylist bar
# $r lrange mylist 0 -1
# $r close
package provide redis 0.1
namespace eval redis
{}
set ::redis::id 0
array set ::redis::fd
{}
array set ::redis::bulkarg
{}
array set ::redis::multibulkarg
{}
# Flag commands requiring last argument as a bulk write operation
foreach redis_bulk_cmd
{
set setnx rpush lpush lset lrem sadd srem sismember echo getset smove zadd zrem zscore
}
{
set ::redis::bulkarg
(
$redis
_bulk_cmd
)
{}
}
# Flag commands requiring last argument as a bulk write operation
foreach redis_multibulk_cmd
{
mset msetnx
}
{
set ::redis::multibulkarg
(
$redis
_multibulk_cmd
)
{}
}
unset redis_bulk_cmd
unset redis_multibulk_cmd
proc redis
{{
server 127.0.0.1
}
{
port 6379
}}
{
set fd
[
socket $server $port
]
fconfigure $fd -translation binary
set id
[
incr ::redis::id
]
set ::redis::fd
(
$id
)
$fd
interp alias
{}
::redis::redisHandle$id
{}
::redis::__dispatch__ $id
}
proc ::redis::__dispatch__
{
id method args
}
{
set fd $::redis::fd
(
$id
)
if
{[
info command ::redis::__method__$method
]
eq
{}}
{
if
{[
info exists ::redis::bulkarg
(
$method
)]}
{
set cmd
"
$method
"
append cmd
[
join
[
lrange $args 0 end-1
]]
append cmd
"
[
string length
[
lindex $args end
]]
\r\n
"
append cmd
[
lindex $args end
]
::redis::redis_writenl $fd $cmd
}
elseif
{[
info exists ::redis::multibulkarg
(
$method
)]}
{
set cmd
"*
[
expr
{[
llength $args
]
+1
}]
\r\n
"
append cmd
"
$
[
string length $method
]
\r\n
$method
\r\n
"
foreach a $args
{
append cmd
"
$
[
string length $a
]
\r\n
$a
\r\n
"
}
::redis::redis_write $fd $cmd
flush $fd
}
else
{
set cmd
"
$method
"
append cmd
[
join $args
]
::redis::redis_writenl $fd $cmd
}
::redis::redis_read_reply $fd
}
else
{
uplevel 1
[
list ::redis::__method__$method $id $fd
]
$args
}
}
proc ::redis::__method__close
{
id fd
}
{
catch
{
close $fd
}
catch
{
unset ::redis::fd
(
$id
)}
catch
{
interp alias
{}
::redis::redisHandle$id
{}}
}
proc ::redis::__method__channel
{
id fd
}
{
return $fd
}
proc ::redis::redis_write
{
fd buf
}
{
puts -nonewline $fd $buf
}
proc ::redis::redis_writenl
{
fd buf
}
{
redis_write $fd $buf
redis_write $fd
"
\r\n
"
flush $fd
}
proc ::redis::redis_readnl
{
fd len
}
{
set buf
[
read $fd $len
]
read $fd 2
;
# discard CR LF
return $buf
}
proc ::redis::redis_bulk_read
{
fd
}
{
set count
[
redis_read_line $fd
]
if
{
$count
== -1
}
return
{}
set buf
[
redis_readnl $fd $count
]
return $buf
}
proc ::redis::redis_multi_bulk_read fd
{
set count
[
redis_read_line $fd
]
if
{
$count
== -1
}
return
{}
set l
{}
for
{
set i 0
}
{
$i
< $count
}
{
incr i
}
{
lappend l
[
redis_read_reply $fd
]
}
return $l
}
proc ::redis::redis_read_line fd
{
string trim
[
gets $fd
]
}
proc ::redis::redis_read_reply fd
{
set type
[
read $fd 1
]
switch -exact -- $type
{
: -
+
{
redis_read_line $fd
}
-
{
return -code error
[
redis_read_line $fd
]}
$
{
redis_bulk_read $fd
}
*
{
redis_multi_bulk_read $fd
}
default
{
return -code error
"Bad protocol,
$type
as reply type byte"
}
}
}
client-libraries/update-clojure-client.sh
deleted
100755 → 0
View file @
5762b7f0
#!/bin/sh
rm
-rf
temp
mkdir
temp
cd
temp
git clone git://github.com/ragnard/redis-clojure.git
cd
redis-clojure
rm
-rf
.git
cd
..
cd
..
rm
-rf
clojure
mv
temp/redis-clojure clojure
rm
-rf
temp
client-libraries/update-cpp-client.sh
deleted
100755 → 0
View file @
5762b7f0
#!/bin/sh
rm
-rf
temp
mkdir
temp
cd
temp
git clone git://github.com/fictorial/redis-cpp-client.git
cd
redis-cpp-client
rm
-rf
.git
cd
..
cd
..
rm
-rf
cpp
mv
temp/redis-cpp-client cpp
rm
-rf
temp
client-libraries/update-erlang-client.sh
deleted
100755 → 0
View file @
5762b7f0
#!/bin/sh
echo
"Sorry for now this must be done by hand... don't know mercurial enough"
client-libraries/update-lua-client.sh
deleted
100755 → 0
View file @
5762b7f0
#!/bin/sh
rm
-rf
temp
mkdir
temp
cd
temp
git clone git://github.com/nrk/redis-lua.git
cd
redis-lua
rm
-rf
.git
cd
..
cd
..
rm
-rf
lua
mv
temp/redis-lua lua
rm
-rf
temp
client-libraries/update-perl-client.sh
deleted
100755 → 0
View file @
5762b7f0
#!/bin/sh
rm
-rf
temp
mkdir
temp
cd
temp
svn checkout svn://svn.rot13.org/Redis/
find
.
-name
'.svn'
-exec
rm
-rf
{}
\;
2> /dev/null
cd
..
rm
-rf
perl
mv
temp/Redis perl
rm
-rf
temp
client-libraries/update-python-client.sh
deleted
100755 → 0
View file @
5762b7f0
#!/bin/sh
rm
-rf
temp
mkdir
temp
cd
temp
git clone git://github.com/ludoo/redis.git
cd
..
rm
-rf
python
mv
temp/redis/client-libraries/python python
rm
-rf
temp
client-libraries/update-ruby-client.sh
deleted
100755 → 0
View file @
5762b7f0
#!/bin/sh
rm
-rf
temp
mkdir
temp
cd
temp
git clone git://github.com/ezmobius/redis-rb.git
#git clone git://github.com/jodosha/redis-rb.git
cd
redis-rb
rm
-rf
.git
cd
..
cd
..
rm
-rf
ruby
mv
temp/redis-rb ruby
rm
-rf
temp
client-libraries/update-scala-client.sh
deleted
100755 → 0
View file @
5762b7f0
#!/bin/sh
rm
-rf
temp
mkdir
temp
cd
temp
git clone git://github.com/acrosa/scala-redis.git
cd
scala-redis
rm
-rf
.git
cd
..
cd
..
rm
-rf
scala
mv
temp/scala-redis scala
rm
-rf
temp
Prev
1
2
3
4
5
6
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment