Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,62 @@ jobs:
working-directory: clients/ember-go
run: go test ./...

msrv:
name: msrv (1.93)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: '1.93'
- uses: Swatinem/rust-cache@v2
- uses: arduino/setup-protoc@v3
with:
version: '28.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: check
run: cargo check --workspace --features protobuf,grpc

python-client:
name: python client
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: install
working-directory: clients/ember-py
run: pip install -e ".[dev]"
- name: test
working-directory: clients/ember-py
run: pytest -v

ts-client:
name: ts client
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: npm
cache-dependency-path: clients/ember-ts/package-lock.json
- name: install
working-directory: clients/ember-ts
run: npm ci
- name: build
working-directory: clients/ember-ts
run: npm run build

proto-drift:
name: client proto drift
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: check clients against canonical proto
run: ./scripts/check-client-drift.sh

security:
name: security
runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion clients/ember-py/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ proto-gen:
--proto_path=../../proto \
ember/v1/ember.proto
# fix generated import path: ember.v1 -> ember.proto.ember.v1
sed -i '' 's/from ember\.v1 import/from ember.proto.ember.v1 import/' \
# (sed -i.bak works with both GNU and BSD sed; bare -i '' is macOS-only)
sed -i.bak 's/from ember\.v1 import/from ember.proto.ember.v1 import/' \
ember/proto/ember/v1/ember_pb2_grpc.py
rm -f ember/proto/ember/v1/ember_pb2_grpc.py.bak

test:
pytest -v
Expand Down
578 changes: 308 additions & 270 deletions clients/ember-py/ember/proto/ember/v1/ember_pb2.py

Large diffs are not rendered by default.

755 changes: 751 additions & 4 deletions clients/ember-py/ember/proto/ember/v1/ember_pb2_grpc.py

Large diffs are not rendered by default.

191 changes: 191 additions & 0 deletions clients/ember-ts/proto/ember/v1/ember.proto
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,47 @@ service EmberCache {
rpc Time(TimeRequest) returns (TimeResponse);
rpc LastSave(LastSaveRequest) returns (IntResponse);

// --- keys (new) ---

rpc Expiretime(ExpiretimeRequest) returns (IntResponse);
rpc Pexpiretime(PexpiretimeRequest) returns (IntResponse);
rpc Expireat(ExpireatRequest) returns (BoolResponse);
rpc Pexpireat(PexpireatRequest) returns (BoolResponse);

// --- strings (new) ---

rpc Getset(GetsetRequest) returns (GetResponse);
rpc Msetnx(MsetnxRequest) returns (BoolResponse);

// --- bitmaps ---

rpc Getbit(GetbitRequest) returns (IntResponse);
rpc Setbit(SetbitRequest) returns (IntResponse);
rpc Bitcount(BitcountRequest) returns (IntResponse);
rpc Bitpos(BitposRequest) returns (IntResponse);
rpc Bitop(BitopRequest) returns (IntResponse);

// --- sets (new) ---

rpc Smove(SmoveRequest) returns (BoolResponse);
rpc Sintercard(SintercardRequest) returns (IntResponse);

// --- lists (new) ---

rpc Lmpop(LmpopRequest) returns (LmpopResponse);

// --- sorted sets (new) ---

rpc Zmpop(ZmpopRequest) returns (ZmpopResponse);

// --- hash (new) ---

rpc Hrandfield(HrandfieldRequest) returns (ArrayResponse);

// --- sorted set random ---

rpc Zrandmember(ZrandmemberRequest) returns (ArrayResponse);

// --- streaming ---
// bidirectional streaming for batch operations, matching RESP3 pipelining.

Expand Down Expand Up @@ -320,6 +361,51 @@ message SetRangeRequest {
bytes value = 3;
}

message GetsetRequest {
string key = 1;
bytes value = 2;
}

message MsetnxRequest {
repeated KeyValue pairs = 1;
}

message GetbitRequest {
string key = 1;
uint64 offset = 2;
}

message SetbitRequest {
string key = 1;
uint64 offset = 2;
uint32 value = 3;
}

message BitcountRequest {
string key = 1;
bool has_range = 2;
int64 start = 3;
int64 end = 4;
// "BYTE" or "BIT" (only used when has_range is true)
string unit = 5;
}

message BitposRequest {
string key = 1;
uint32 bit = 2;
bool has_range = 3;
int64 start = 4;
int64 end = 5;
string unit = 6;
}

message BitopRequest {
// "AND", "OR", "XOR", or "NOT"
string op = 1;
string dest = 2;
repeated string keys = 3;
}

// ---------------------------------------------------------------------------
// keys
// ---------------------------------------------------------------------------
Expand Down Expand Up @@ -400,6 +486,24 @@ message TouchRequest {
repeated string keys = 1;
}

message ExpiretimeRequest {
string key = 1;
}

message PexpiretimeRequest {
string key = 1;
}

message ExpireatRequest {
string key = 1;
uint64 timestamp = 2;
}

message PexpireatRequest {
string key = 1;
uint64 timestamp_ms = 2;
}

// ---------------------------------------------------------------------------
// lists
// ---------------------------------------------------------------------------
Expand Down Expand Up @@ -484,6 +588,19 @@ message LMoveRequest {
bool dst_left = 4;
}

message LmpopRequest {
repeated string keys = 1;
// true = LEFT, false = RIGHT
bool left = 2;
uint32 count = 3;
}

message LmpopResponse {
bool found = 1;
string key = 2;
repeated bytes elements = 3;
}

// ---------------------------------------------------------------------------
// hashes
// ---------------------------------------------------------------------------
Expand Down Expand Up @@ -561,6 +678,13 @@ message HScanResponse {
repeated FieldValue fields = 2;
}

message HrandfieldRequest {
string key = 1;
bool has_count = 2;
int32 count = 3;
bool with_values = 4;
}

// ---------------------------------------------------------------------------
// sets
// ---------------------------------------------------------------------------
Expand Down Expand Up @@ -631,6 +755,18 @@ message SMisMemberRequest {
repeated string members = 2;
}

message SmoveRequest {
string source = 1;
string destination = 2;
string member = 3;
}

message SintercardRequest {
repeated string keys = 1;
// 0 means no limit
uint64 limit = 2;
}

message SScanRequest {
string key = 1;
uint64 cursor = 2;
Expand Down Expand Up @@ -770,6 +906,26 @@ message ZUnionRequest {
bool with_scores = 2;
}

message ZmpopRequest {
repeated string keys = 1;
// true = MIN, false = MAX
bool min = 2;
uint32 count = 3;
}

message ZmpopResponse {
bool found = 1;
string key = 2;
repeated ScoreMember members = 3;
}

message ZrandmemberRequest {
string key = 1;
bool has_count = 2;
int32 count = 3;
bool with_scores = 4;
}

message ZScanRequest {
string key = 1;
uint64 cursor = 2;
Expand Down Expand Up @@ -1124,6 +1280,39 @@ message PipelineRequest {
// extended server
TimeRequest time = 110;
LastSaveRequest last_save = 111;

// new keys
ExpiretimeRequest expiretime = 112;
PexpiretimeRequest pexpiretime = 113;
ExpireatRequest expireat = 114;
PexpireatRequest pexpireat = 115;

// new strings
GetsetRequest getset = 116;
MsetnxRequest msetnx = 117;

// bitmaps
GetbitRequest getbit = 118;
SetbitRequest setbit = 119;
BitcountRequest bitcount = 120;
BitposRequest bitpos = 121;
BitopRequest bitop = 122;

// new sets
SmoveRequest smove = 123;
SintercardRequest sintercard = 124;

// new lists
LmpopRequest lmpop = 125;

// new sorted sets
ZmpopRequest zmpop = 126;

// new hash
HrandfieldRequest hrandfield = 127;

// sorted set random
ZrandmemberRequest zrandmember = 128;
}
}

Expand Down Expand Up @@ -1163,6 +1352,8 @@ message PipelineResponse {
ZScanResponse zscan = 32;
SScanResponse sscan = 33;
TimeResponse time_resp = 34;
LmpopResponse lmpop = 35;
ZmpopResponse zmpop = 36;
}
}

Expand Down
19 changes: 19 additions & 0 deletions clients/ember-ts/src/generated/ember/v1/BitcountRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Original file: ../../proto/ember/v1/ember.proto

import type { Long } from '@grpc/proto-loader';

export interface BitcountRequest {
'key'?: (string);
'hasRange'?: (boolean);
'start'?: (number | string | Long);
'end'?: (number | string | Long);
'unit'?: (string);
}

export interface BitcountRequest__Output {
'key'?: (string);
'hasRange'?: (boolean);
'start'?: (Long);
'end'?: (Long);
'unit'?: (string);
}
14 changes: 14 additions & 0 deletions clients/ember-ts/src/generated/ember/v1/BitopRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Original file: ../../proto/ember/v1/ember.proto


export interface BitopRequest {
'op'?: (string);
'dest'?: (string);
'keys'?: (string)[];
}

export interface BitopRequest__Output {
'op'?: (string);
'dest'?: (string);
'keys'?: (string)[];
}
21 changes: 21 additions & 0 deletions clients/ember-ts/src/generated/ember/v1/BitposRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Original file: ../../proto/ember/v1/ember.proto

import type { Long } from '@grpc/proto-loader';

export interface BitposRequest {
'key'?: (string);
'bit'?: (number);
'hasRange'?: (boolean);
'start'?: (number | string | Long);
'end'?: (number | string | Long);
'unit'?: (string);
}

export interface BitposRequest__Output {
'key'?: (string);
'bit'?: (number);
'hasRange'?: (boolean);
'start'?: (Long);
'end'?: (Long);
'unit'?: (string);
}
Loading
Loading