Skip to content

Commit 15f1f20

Browse files
committed
initial commit
0 parents  commit 15f1f20

18 files changed

+779
-0
lines changed

.babelrc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"presets": [
3+
"es2015-node6",
4+
"stage-0"
5+
],
6+
"sourceMaps": "inline",
7+
"plugins": ["transform-class-properties"],
8+
"ignore": [
9+
"lib/**/*.js",
10+
"node_modules"
11+
]
12+
}

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true

.eslintrc

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"parser": "babel-eslint",
3+
"extends": [
4+
"airbnb"
5+
],
6+
"rules": {
7+
"max-len": 0,
8+
"no-underscore-dangle": 0,
9+
"no-param-reassign": 0,
10+
"import/no-unresolved": 0
11+
},
12+
"globals": {
13+
"describe": true,
14+
"RediBox": true,
15+
"RediBoxCluster": true,
16+
"HOOK_NAME": true,
17+
"beforeEach": true,
18+
"Hook": true,
19+
"HookCluster": true,
20+
"it": true,
21+
"before": true,
22+
"after": true
23+
}
24+
}

.flowconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[ignore]
2+
.*/node_modules/
3+
.*/lib/
4+
5+
[include]
6+
7+
[libs]
8+
9+
[options]

.gitignore

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Logs
2+
logs
3+
*.log
4+
5+
# Runtime data
6+
pids
7+
*.pid
8+
*.seed
9+
10+
# Directory for instrumented libs generated by jscoverage/JSCover
11+
lib-cov
12+
13+
# Coverage directory used by tools like istanbul
14+
coverage
15+
test.js
16+
17+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
18+
.grunt
19+
20+
# node-waf configuration
21+
.lock-wscript
22+
23+
# Compiled binary addons (http://nodejs.org/api/addons.html)
24+
build/Release
25+
26+
# Dependency directory
27+
node_modules
28+
29+
# Babel compiled sources
30+
lib
31+
32+
# Miscellaneous
33+
*~
34+
*#
35+
.DS_STORE
36+
.netbeans
37+
nbproject
38+
.idea
39+
.node_history
40+
test.js
41+
benchmark

.npmignore

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Automatically ignored per:
2+
# https://www.npmjs.org/doc/developers.html#Keeping-files-out-of-your-package
3+
#
4+
# .*.swp
5+
# ._*
6+
# .DS_Store
7+
# .git
8+
# .hg
9+
# .lock-wscript
10+
# .svn
11+
# .wafpickle-*
12+
# CVS
13+
# npm-debug.log
14+
# node_modules
15+
16+
*.seed
17+
*.log
18+
*.csv
19+
*.dat
20+
*.out
21+
*.pid
22+
*.gz
23+
*.orig
24+
25+
work
26+
build
27+
src
28+
test
29+
tests-hook.js
30+
pids
31+
logs
32+
results
33+
coverage
34+
lib-cov
35+
html-report
36+
xunit.xml
37+
38+
.project
39+
.idea
40+
.settings
41+
.iml
42+
*.sublime-workspace
43+
*.sublime-project
44+
45+
ehthumbs.db
46+
Icon?
47+
Thumbs.db
48+
.AppleDouble
49+
.LSOverride
50+
.Spotlight-V100
51+
.Trashes

.travis.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
sudo: false
2+
3+
language: node_js
4+
5+
node_js:
6+
- "6"
7+
8+
services:
9+
- redis-server
10+
11+
install: make travis-install
12+
script: make travis-run

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 Mike Diarmid
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

+138
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
PATH := ./redis-git/src:${PATH}
2+
3+
# CLUSTER REDIS NODES
4+
define NODE1_CONF
5+
daemonize yes
6+
port 30001
7+
cluster-node-timeout 5000
8+
pidfile /tmp/redis_cluster_node1.pid
9+
logfile /tmp/redis_cluster_node1.log
10+
save ""
11+
appendonly no
12+
cluster-enabled yes
13+
cluster-config-file /tmp/redis_cluster_node1.conf
14+
endef
15+
16+
define NODE2_CONF
17+
daemonize yes
18+
port 30002
19+
cluster-node-timeout 5000
20+
pidfile /tmp/redis_cluster_node2.pid
21+
logfile /tmp/redis_cluster_node2.log
22+
save ""
23+
appendonly no
24+
cluster-enabled yes
25+
cluster-config-file /tmp/redis_cluster_node2.conf
26+
endef
27+
28+
define NODE3_CONF
29+
daemonize yes
30+
port 30003
31+
cluster-node-timeout 5000
32+
pidfile /tmp/redis_cluster_node3.pid
33+
logfile /tmp/redis_cluster_node3.log
34+
save ""
35+
appendonly no
36+
cluster-enabled yes
37+
cluster-config-file /tmp/redis_cluster_node3.conf
38+
endef
39+
40+
define NODE4_CONF
41+
daemonize yes
42+
port 30004
43+
cluster-node-timeout 5000
44+
pidfile /tmp/redis_cluster_node4.pid
45+
logfile /tmp/redis_cluster_node4.log
46+
save ""
47+
appendonly no
48+
cluster-enabled yes
49+
cluster-config-file /tmp/redis_cluster_node4.conf
50+
endef
51+
52+
define NODE5_CONF
53+
daemonize yes
54+
port 30005
55+
cluster-node-timeout 5000
56+
pidfile /tmp/redis_cluster_node5.pid
57+
logfile /tmp/redis_cluster_node5.log
58+
save ""
59+
appendonly no
60+
cluster-enabled yes
61+
cluster-config-file /tmp/redis_cluster_node5.conf
62+
endef
63+
64+
define NODE6_CONF
65+
daemonize yes
66+
port 30006
67+
cluster-node-timeout 5000
68+
pidfile /tmp/redis_cluster_node6.pid
69+
logfile /tmp/redis_cluster_node6.log
70+
save ""
71+
appendonly no
72+
cluster-enabled yes
73+
cluster-config-file /tmp/redis_cluster_node6.conf
74+
endef
75+
76+
export NODE1_CONF
77+
export NODE2_CONF
78+
export NODE3_CONF
79+
export NODE4_CONF
80+
export NODE5_CONF
81+
export NODE6_CONF
82+
83+
help:
84+
@echo "Please use 'make <target>' where <target> is one of"
85+
@echo " start starts a test redis cluster"
86+
@echo " cleanup cleanup config files after redis cluster"
87+
@echo " stop stops all redis servers"
88+
@echo " travis-run starts the redis cluster and runs your tests"
89+
@echo " travis-install install redis from 'unstable' branch"
90+
91+
start: cleanup
92+
echo "$$NODE1_CONF" | redis-server -
93+
echo "$$NODE2_CONF" | redis-server -
94+
echo "$$NODE3_CONF" | redis-server -
95+
echo "$$NODE4_CONF" | redis-server -
96+
echo "$$NODE5_CONF" | redis-server -
97+
echo "$$NODE6_CONF" | redis-server -
98+
99+
cleanup:
100+
- rm -vf /tmp/redis_cluster_node*.conf 2>/dev/null
101+
- rm -f /tmp/redis_cluster_node1.conf
102+
- rm dump.rdb appendonly.aof - 2>/dev/null
103+
104+
stop:
105+
kill `cat /tmp/redis_cluster_node1.pid` || true
106+
kill `cat /tmp/redis_cluster_node2.pid` || true
107+
kill `cat /tmp/redis_cluster_node3.pid` || true
108+
kill `cat /tmp/redis_cluster_node4.pid` || true
109+
kill `cat /tmp/redis_cluster_node5.pid` || true
110+
kill `cat /tmp/redis_cluster_node6.pid` || true
111+
make cleanup
112+
113+
travis-run:
114+
# Start all cluster nodes
115+
make start
116+
sleep 5
117+
118+
# Join all nodes in the cluster
119+
echo "yes" | ruby redis-git/src/redis-trib.rb create --replicas 1 127.0.0.1:30001 127.0.0.1:30002 127.0.0.1:30003 127.0.0.1:30004 127.0.0.1:30005 127.0.0.1:30006
120+
sleep 5
121+
122+
#########
123+
# Run your tests/code here
124+
# For example: py.test
125+
#########
126+
npm install
127+
npm run prepublish
128+
npm run test
129+
npm run coveralls
130+
131+
# Kill all redis nodes and do cleanup
132+
make stop
133+
134+
travis-install:
135+
[ ! -e redis-git ] && git clone https://github.com/antirez/redis.git redis-git || true
136+
make -C redis-git -j4
137+
gem install redis
138+
sleep 3

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[![Coverage Status](https://coveralls.io/repos/github/redibox/schedule/badge.svg?branch=master)](https://coveralls.io/github/redibox/schedule?branch=master)
2+
![Downloads](https://img.shields.io/npm/dt/redibox-hook-cache.svg)
3+
[![npm version](https://img.shields.io/npm/v/redibox-hook-cache.svg)](https://www.npmjs.com/package/redibox-hook-schedule)
4+
[![dependencies](https://img.shields.io/david/redibox/schedule.svg)](https://david-dm.org/redibox/schedule)
5+
[![build](https://travis-ci.org/redibox/schedule.svg)](https://travis-ci.org/redibox/schedule)
6+
[![License](https://img.shields.io/npm/l/redibox-hook-cache.svg)](/LICENSE)
7+
8+
## RediBox MemSet
9+
10+
TODO

0 commit comments

Comments
 (0)