Skip to content

Commit

Permalink
feat: add sorted set commands (momentohq#123)
Browse files Browse the repository at this point in the history
Adds the sorted set commands for the Momento protocol to the SDK.
  • Loading branch information
brayniac authored Feb 22, 2023
1 parent 7f12f0a commit 34b5d93
Show file tree
Hide file tree
Showing 4 changed files with 424 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ pub use crate::simple_cache_client::{
};

pub type MomentoResult<T> = Result<T, MomentoError>;

pub mod sorted_set {
pub use momento_protos::cache_client::sorted_set_fetch_request::{Order, Range};
pub use momento_protos::cache_client::SortedSetElement;
}
7 changes: 7 additions & 0 deletions src/response/cache_sorted_set_fetch_response.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
use momento_protos::cache_client::SortedSetElement;

#[derive(Debug)]
#[non_exhaustive]
pub struct MomentoSortedSetFetchResponse {
pub value: Option<Vec<SortedSetElement>>,
}
2 changes: 2 additions & 0 deletions src/response/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ mod cache_dictionary_get_response;
mod cache_dictionary_increment_response;
mod cache_get_response;
mod cache_set_fetch_response;
mod cache_sorted_set_fetch_response;
mod create_signing_key_response;
mod error;
mod flush_cache_response;
Expand All @@ -14,6 +15,7 @@ pub use self::cache_dictionary_get_response::*;
pub use self::cache_dictionary_increment_response::*;
pub use self::cache_get_response::*;
pub use self::cache_set_fetch_response::*;
pub use self::cache_sorted_set_fetch_response::*;
pub use self::create_signing_key_response::*;
pub use self::error::*;
pub use self::flush_cache_response::*;
Expand Down
Loading

0 comments on commit 34b5d93

Please sign in to comment.