Skip to content

Commit 170b74b

Browse files
authored
Feat: unified key-value store abstraction and adapters (#165)
* Implements a provider-neutral KV store interface with support for Axum, Fastly, and Cloudflare
1 parent b7cd5e1 commit 170b74b

File tree

39 files changed

+3988
-55
lines changed

39 files changed

+3988
-55
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,14 @@ jobs:
4343
with:
4444
toolchain: ${{ steps.rust-version.outputs.rust-version }}
4545

46-
- name: Add wasm32-wasi target
47-
run: rustup target add wasm32-wasip1
46+
- name: Add wasm targets
47+
run: rustup target add wasm32-wasip1 wasm32-unknown-unknown
4848

4949
- name: Setup Viceroy
50-
run: cargo install viceroy --locked
50+
run: |
51+
if ! command -v viceroy &>/dev/null; then
52+
cargo install viceroy --locked
53+
fi
5154
5255
- name: Fetch dependencies (locked)
5356
run: cargo fetch --locked
@@ -57,3 +60,9 @@ jobs:
5760

5861
- name: Check feature compilation
5962
run: cargo check --workspace --all-targets --features "fastly cloudflare"
63+
64+
- name: Check Fastly wasm target
65+
run: cargo check -p edgezero-adapter-fastly --features fastly --target wasm32-wasip1
66+
67+
- name: Check Cloudflare wasm target
68+
run: cargo check -p edgezero-adapter-cloudflare --features cloudflare --target wasm32-unknown-unknown

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
# node
2+
node_modules/
3+
14
# compiled output
25
bin/
36
pkg/
47
target/
58
.wrangler/
9+
.edgezero/
610

711
# env
812
.env

Cargo.lock

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ log = "0.4"
4848
log-fastly = "0.11"
4949
matchit = "0.9"
5050
once_cell = "1"
51+
redb = "3.1.0"
5152
reqwest = { version = "0.13", default-features = false, features = ["rustls"] }
5253
serde = { version = "1", features = ["derive"] }
5354
serde_json = "1"

crates/edgezero-adapter-axum/Cargo.toml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,26 @@ license = { workspace = true }
77

88
[features]
99
default = ["axum"]
10-
axum = ["dep:axum", "dep:tokio", "dep:tower", "dep:futures-util", "dep:reqwest"]
11-
cli = ["dep:edgezero-adapter", "edgezero-adapter/cli", "dep:ctor", "dep:toml", "dep:walkdir"]
10+
axum = [
11+
"dep:axum",
12+
"dep:tokio",
13+
"dep:tower",
14+
"dep:futures-util",
15+
"dep:reqwest",
16+
"dep:redb",
17+
]
18+
cli = [
19+
"dep:edgezero-adapter",
20+
"edgezero-adapter/cli",
21+
"dep:ctor",
22+
"dep:toml",
23+
"dep:walkdir",
24+
]
1225

1326
[dependencies]
14-
edgezero-adapter = { path = "../edgezero-adapter", optional = true, features = ["cli"] }
27+
edgezero-adapter = { path = "../edgezero-adapter", optional = true, features = [
28+
"cli",
29+
] }
1530
edgezero-core = { path = "../edgezero-core" }
1631
anyhow = { workspace = true }
1732
async-trait = { workspace = true }
@@ -22,6 +37,7 @@ futures = { workspace = true }
2237
futures-util = { workspace = true, optional = true }
2338
http = { workspace = true }
2439
log = { workspace = true }
40+
redb = { workspace = true, optional = true }
2541
reqwest = { workspace = true, optional = true }
2642
simple_logger = { workspace = true }
2743
thiserror = { workspace = true }
@@ -34,5 +50,6 @@ walkdir = { workspace = true, optional = true }
3450
[dev-dependencies]
3551
async-trait = { workspace = true }
3652
axum = { workspace = true, features = ["macros"] }
53+
serde = { workspace = true }
3754
tempfile = { workspace = true }
3855
tokio = { workspace = true, features = ["macros", "rt", "rt-multi-thread"] }

0 commit comments

Comments
 (0)