Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added functions to ctx for RedisModule_GetClient* #180

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

dmitrypol
Copy link
Collaborator

@dmitrypol dmitrypol commented Feb 24, 2025

  • added functions to Context to get_client_id, name, username, info and certificate in separate client.rs
  • added example and tests

ValkeyString::from_redis_module_string(self.ctx, client_cert)
}

pub fn get_client_info(&self) -> ValkeyValue {
Copy link
Collaborator Author

@dmitrypol dmitrypol Feb 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KarthikSubbarao - I decided to just return u64 here, we can revisit it later redis/redis#13828 (comment)

@@ -829,6 +830,36 @@ impl Context {
.map_err(|_e| ValkeyError::Str("User does not have permissions on key"))
}

pub fn get_client_id(&self) -> u64 {
Copy link
Collaborator Author

@dmitrypol dmitrypol Feb 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KarthikSubbarao - also since mod.rs is a very large file I moved these to a new filesrc/context/client.rs and did impl Context for these 5 functions.

dmitrypol and others added 6 commits February 25, 2025 08:01
* updated version to 0.1.3

Signed-off-by: Dmitry Polyakovsky <[email protected]>

* Add support for generating bindings on ValkeyModule APIs (valkey-io#172)

* Add support for generating bindings on ValkeyModule APIs

Signed-off-by: Karthik Subbarao <[email protected]>

* Update header files to match latest OSS core engine header files

Signed-off-by: Karthik Subbarao <[email protected]>

---------

Signed-off-by: Karthik Subbarao <[email protected]>
Signed-off-by: Dmitry Polyakovsky <[email protected]>

* minor cleanup tests and data_type2.rs
updated dependencies

Signed-off-by: Dmitry Polyakovsky <[email protected]>

---------

Signed-off-by: Dmitry Polyakovsky <[email protected]>
Signed-off-by: Karthik Subbarao <[email protected]>
Co-authored-by: Dmitry Polyakovsky <[email protected]>
Co-authored-by: KarthikSubbarao <[email protected]>
Signed-off-by: Dmitry Polyakovsky <[email protected]>
Signed-off-by: Dmitry Polyakovsky <[email protected]>
added example and tests

Signed-off-by: Dmitry Polyakovsky <[email protected]>
Signed-off-by: Dmitry Polyakovsky <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants