Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
keroxp authored Apr 11, 2020
1 parent dc844c1 commit a873d8a
Show file tree
Hide file tree
Showing 22 changed files with 140 additions and 138 deletions.
2 changes: 1 addition & 1 deletion .denov
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.39.0
v0.40.0
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ jobs:
- uses: actions/checkout@v1
- name: Install Deno
run: |
DENO_VERSION=$(cat .denov)
curl -fsSL https://deno.land/x/install/install.sh | bash -s -- ${DENO_VERSION}
echo "::set-env name=DENO_VERSION::$(cat .denov)"
- uses: denolib/setup-deno@master
with:
deno-version: ${{ env.DENO_VERSION }}
- name: Run Tests
run: |
export PATH=$HOME/.local/bin:$PATH
make test
2 changes: 1 addition & 1 deletion .github/workflows/bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- 6379:6379
steps:
- uses: actions/checkout@v1
- uses: keroxp/dink-bot@v1
- uses: keroxp/dink-bot@master
with:
github-repository: ${{ github.repository }}
github-token: ${{ secrets.GITHUB_TOKEN }}
60 changes: 30 additions & 30 deletions command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export type RedisCommands = {
copy?: boolean;
replace?: boolean;
keys?: string[];
},
}
): Promise<Status>;
move(key: string, db: string): Promise<Integer>;
object_refcount(key: string): Promise<Integer | BulkNil>;
Expand All @@ -54,7 +54,7 @@ export type RedisCommands = {
key: string,
ttl: number,
serialized_value: string,
replace?: boolean,
replace?: boolean
): Promise<Status>;

sort(
Expand All @@ -66,7 +66,7 @@ export type RedisCommands = {
patterns?: string[];
order: "ASC" | "DESC";
alpha?: boolean;
},
}
): Promise<BulkString[]>;

sort(
Expand All @@ -79,7 +79,7 @@ export type RedisCommands = {
order: "ASC" | "DESC";
alpha?: boolean;
destination: string;
},
}
): Promise<Integer>;

touch(...keys: string[]): Promise<Integer>;
Expand Down Expand Up @@ -111,7 +111,7 @@ export type RedisCommands = {
key: string,
bit: number,
start?: number,
end?: number,
end?: number
): Promise<Integer>;
decr(key: string): Promise<Integer>;
decrby(key: string, decrement: number): Promise<Integer>;
Expand All @@ -130,7 +130,7 @@ export type RedisCommands = {
opts?: {
ex?: number;
px?: number;
},
}
): Promise<Status>;
set(
key: string,
Expand All @@ -139,7 +139,7 @@ export type RedisCommands = {
ex?: number;
px?: number;
mode: "NX" | "XX";
},
}
): Promise<Status | BulkNil>;
setbit(key: string, offset: number, value: string): Promise<Integer>;
setex(key: string, seconds: number, value: string): Promise<Status>;
Expand All @@ -155,7 +155,7 @@ export type RedisCommands = {
key: string,
longitude: number,
latitude: number,
member: string,
member: string
): Promise<Integer>;
geoadd(
key: string,
Expand All @@ -169,7 +169,7 @@ export type RedisCommands = {
key: string,
member1: string,
member2: string,
unit?: "m" | "km" | "ft" | "mi",
unit?: "m" | "km" | "ft" | "mi"
): Promise<Bulk>;
// FIXME: Return type is too conditional
georadius(
Expand All @@ -186,7 +186,7 @@ export type RedisCommands = {
sort?: "ASC" | "DESC";
store?: string;
storeDist?: string;
},
}
): Promise<ConditionalArray>;
// FIXME: Return type is too conditional
georadiusbymember(
Expand All @@ -202,7 +202,7 @@ export type RedisCommands = {
sort?: "ASC" | "DESC";
store?: string;
storeDist?: string;
},
}
): Promise<ConditionalArray>;
// Hash
hdel(key: string, ...fields: string[]): Promise<Integer>;
Expand Down Expand Up @@ -231,14 +231,14 @@ export type RedisCommands = {
brpoplpush(
source: string,
destination: string,
timeout: number,
timeout: number
): Promise<Bulk | []>;
lindex(key: string, index: number): Promise<Bulk>;
linsert(
key: string,
loc: "BEFORE" | "AFTER",
pivot: string,
value: string,
value: string
): Promise<Integer>;
llen(key: string): Promise<Integer>;
lpop(key: string): Promise<Bulk>;
Expand Down Expand Up @@ -300,7 +300,7 @@ export type RedisCommands = {
nxx?: "NX" | "XX";
ch?: boolean;
incr?: boolean;
},
}
): Promise<Integer>;
zadd(
key: string,
Expand All @@ -309,7 +309,7 @@ export type RedisCommands = {
nxx?: "NX" | "XX";
ch?: boolean;
incr?: boolean;
},
}
): Promise<Integer>;
zcard(key: string): Promise<Integer>;
zcount(key: string, min: number, max: number): Promise<Integer>;
Expand All @@ -319,7 +319,7 @@ export type RedisCommands = {
numkeys: number,
keys: string | string[],
weights?: number | number[],
aggregate?: "SUM" | "MIN" | "MAX",
aggregate?: "SUM" | "MIN" | "MAX"
): Promise<Integer>;
zlexcount(key: string, min: string, max: string): Promise<Integer>;
zpopmax(key: string, count?: number): Promise<BulkString[]>;
Expand All @@ -330,7 +330,7 @@ export type RedisCommands = {
stop: number,
opts?: {
withScore?: boolean;
},
}
): Promise<BulkString[]>;
zrangebylex(
key: string,
Expand All @@ -339,7 +339,7 @@ export type RedisCommands = {
opts?: {
offset?: number;
count?: number;
},
}
): Promise<BulkString[]>;
zrevrangebylex(
key: string,
Expand All @@ -348,7 +348,7 @@ export type RedisCommands = {
opts?: {
offset?: number;
count?: number;
},
}
): Promise<BulkString[]>;
zrangebyscore(
key: string,
Expand All @@ -358,7 +358,7 @@ export type RedisCommands = {
withScore?: boolean;
offset?: number;
count?: number;
},
}
): Promise<BulkString[]>;
zrank(key: string, member: string): Promise<Integer | BulkNil>;
zrem(key: string, ...members: string[]): Promise<Integer>;
Expand All @@ -371,7 +371,7 @@ export type RedisCommands = {
stop: number,
opts?: {
withScore?: boolean;
},
}
): Promise<BulkString[]>;
zrevrangebyscore(
key: string,
Expand All @@ -381,7 +381,7 @@ export type RedisCommands = {
withScore?: boolean;
offset?: number;
count?: number;
},
}
): Promise<BulkString[]>;
zrevrank(key: string, member: string): Promise<Integer | BulkNil>;
zscore(key: string, member: string): Promise<Bulk>;
Expand All @@ -391,7 +391,7 @@ export type RedisCommands = {
opts?: {
weights?: number[];
aggregate?: "SUM" | "MIN" | "MAX";
},
}
): Promise<Integer>;
// Cluster
// cluster //
Expand All @@ -411,7 +411,7 @@ export type RedisCommands = {
Integer,
Integer,
Integer,
[BulkString[]],
[BulkString[]]
] | BulkNil]>;
config_get(parameter: string): Promise<BulkString[]>;
config_rewrite(): Promise<Status>;
Expand All @@ -433,11 +433,11 @@ export type RedisCommands = {
key: string,
opts?: {
samples?: number;
},
}
): Promise<Integer>;
monitor(): void;
role(): Promise<
| ["master", Integer, BulkString[][]]
["master", Integer, BulkString[][]]
| ["slave", BulkString, Integer, BulkString, Integer]
| ["sentinel", BulkString[]]
>;
Expand Down Expand Up @@ -475,30 +475,30 @@ export type RedisCommands = {
opts?: {
pattern?: string;
count?: number;
},
}
): Promise<[BulkString, BulkString[]]>;
hscan(
key: string,
cursor: number,
opts?: {
pattern?: string;
count?: number;
},
}
): Promise<[BulkString, BulkString[]]>;
sscan(
key: string,
cursor: number,
opts?: {
pattern?: string;
count?: number;
},
}
): Promise<[BulkString, BulkString[]]>;
zscan(
key: string,
cursor: number,
opts?: {
pattern?: string;
},
}
): Promise<[BulkString, BulkString[]]>;

readonly isClosed: boolean;
Expand Down
5 changes: 3 additions & 2 deletions io.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export type StatusReply = ["status", Status];
export type IntegerReply = ["integer", Integer];
export type BulkReply = ["bulk", Bulk];
export type ArrayReply = ["array", ConditionalArray];
export type RedisRawReply = StatusReply | IntegerReply | BulkReply | ArrayReply;
export type RedisRawReply = StatusReply | IntegerReply | BulkReply
| ArrayReply;

export type CommandFunc<T> = (
comand: string,
Expand Down Expand Up @@ -171,7 +172,7 @@ function tryParseErrorReply(line: string): never {

export function muxExecutor(
r: BufReader,
w: BufWriter,
w: BufWriter
): CommandExecutor {
let queue: {
command: string;
Expand Down
2 changes: 1 addition & 1 deletion modules-lock.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"https://deno.land/std": {
"version": "@v0.39.0",
"version": "@v0.40.0",
"modules": [
"/util/async.ts",
"/testing/asserts.ts",
Expand Down
4 changes: 2 additions & 2 deletions modules.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"https://deno.land/std": {
"version": "@v0.39.0",
"version": "@v0.40.0",
"modules": [
"/util/async.ts",
"/testing/asserts.ts",
"/io/bufio.ts",
"/fmt/colors.ts"
]
}
}
}
4 changes: 2 additions & 2 deletions pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export type RedisPipeline = {
export function createRedisPipeline(
writer: BufWriter,
reader: BufReader,
opts?: { tx: true },
opts?: { tx: true }
): RedisPipeline {
let commands: string[] = [];
let queue: {
Expand Down Expand Up @@ -108,6 +108,6 @@ function dummyReadWriteCloser(): Deno.ReadWriteCloser {
},
async write(p) {
return 0;
},
}
};
}
Loading

0 comments on commit a873d8a

Please sign in to comment.