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
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions ldk-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ prost = { version = "0.11.6", default-features = false, features = ["std"] }
ldk-server-protos = { path = "../ldk-server-protos" }
bytes = "1.4.0"
hex = { package = "hex-conservative", version = "0.2.1", default-features = false }
rusqlite = { version = "0.28.0", features = ["bundled"] }

[dev-dependencies]
rand = "0.8.5"
2 changes: 2 additions & 0 deletions ldk-server/src/io/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
pub(crate) mod paginated_kv_store;
pub(crate) mod sqlite_store;
pub(crate) mod utils;
7 changes: 4 additions & 3 deletions ldk-server/src/io/paginated_kv_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub trait PaginatedKVStore {
/// `primary_namespace`, ordered in descending order of `time`.
///
/// The `list` method returns the latest records first, based on the `time` associated with each key.
/// Pagination is controlled by the `next_page_token`, which is an `Option<String>`
/// Pagination is controlled by the `next_page_token`, which is an `Option<(String, i64)>`
/// used to determine the starting point for the next page of results. If `next_page_token` is `None`,
/// the listing starts from the most recent entry. The `next_page_token` in the returned
/// [`ListResponse`] can be used to fetch the next page of results.
Expand All @@ -85,7 +85,8 @@ pub trait PaginatedKVStore {
///
/// [`ListResponse`]: struct.ListResponse.html
fn list(
&self, primary_namespace: &str, secondary_namespace: &str, next_page_token: Option<String>,
&self, primary_namespace: &str, secondary_namespace: &str,
next_page_token: Option<(String, i64)>,
) -> Result<ListResponse, io::Error>;
}

Expand All @@ -98,5 +99,5 @@ pub struct ListResponse {
pub keys: Vec<String>,

/// A token that can be used to retrieve the next set of keys.
pub next_page_token: Option<String>,
pub next_page_token: Option<(String, i64)>,
}
Loading