Skip to content

Commit 1c1f8b0

Browse files
committed
Merge host component key value implementations into new factor crates
Signed-off-by: Caleb Schoepp <[email protected]>
1 parent 8fda052 commit 1c1f8b0

File tree

29 files changed

+508
-748
lines changed

29 files changed

+508
-748
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ spin-common = { path = "crates/common" }
4949
spin-doctor = { path = "crates/doctor" }
5050
spin-expressions = { path = "crates/expressions" }
5151
spin-http = { path = "crates/http" }
52-
spin-key-value = { path = "crates/key-value" }
53-
spin-key-value-sqlite = { path = "crates/key-value-sqlite" }
5452
spin-loader = { path = "crates/loader" }
5553
spin-locked-app = { path = "crates/locked-app" }
5654
spin-manifest = { path = "crates/manifest" }

crates/factor-key-value-azure/Cargo.toml

Lines changed: 0 additions & 19 deletions
This file was deleted.

crates/factor-key-value-azure/src/lib.rs

Lines changed: 0 additions & 58 deletions
This file was deleted.

crates/factor-key-value-redis/Cargo.toml

Lines changed: 0 additions & 15 deletions
This file was deleted.

crates/factor-key-value-redis/src/lib.rs

Lines changed: 0 additions & 38 deletions
This file was deleted.

crates/factor-key-value-spin/Cargo.toml

Lines changed: 0 additions & 15 deletions
This file was deleted.

crates/factor-key-value/Cargo.toml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,20 @@ edition = { workspace = true }
66

77
[dependencies]
88
anyhow = "1.0"
9+
lru = "0.9.0"
910
serde = { version = "1.0", features = ["rc"] }
11+
spin-core = { path = "../core" }
1012
spin-factors = { path = "../factors" }
11-
# TODO: merge with this crate
12-
spin-key-value = { path = "../key-value" }
13+
spin-locked-app = { path = "../locked-app" }
1314
spin-world = { path = "../world" }
15+
table = { path = "../table" }
16+
tokio = { version = "1", features = ["macros", "sync", "rt"] }
1417
toml = "0.8"
18+
tracing = { workspace = true }
1519

1620
[dev-dependencies]
17-
spin-factor-key-value-redis = { path = "../factor-key-value-redis" }
18-
spin-factor-key-value-spin = { path = "../factor-key-value-spin" }
21+
spin-key-value-redis = { path = "../key-value-redis" }
22+
spin-key-value-spin = { path = "../key-value-spin" }
1923
spin-factors-test = { path = "../factors-test" }
2024
tempfile = "3.12.0"
2125
tokio = { version = "1", features = ["macros", "rt"] }

crates/key-value/src/lib.rs renamed to crates/factor-key-value/src/host.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1+
use crate::util::EmptyStoreManager;
12
use anyhow::{Context, Result};
2-
use spin_app::MetadataKey;
33
use spin_core::{async_trait, wasmtime::component::Resource};
4+
use spin_locked_app::MetadataKey;
45
use spin_world::v2::key_value;
56
use std::{collections::HashSet, sync::Arc};
67
use table::Table;
78

8-
// TODO(factors): Code left for reference; remove after migration to factors
9-
// mod host_component;
10-
mod util;
11-
12-
pub use util::{
13-
CachingStoreManager, DefaultManagerGetter, DelegatingStoreManager, EmptyStoreManager,
14-
};
15-
169
pub const KEY_VALUE_STORES_KEY: MetadataKey<Vec<String>> = MetadataKey::new("key_value_stores");
1710

1811
const DEFAULT_STORE_TABLE_CAPACITY: u32 = 256;

0 commit comments

Comments
 (0)