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

How to remove shared data key using rust? #301

Open
leandrocurioso opened this issue Jan 31, 2025 · 1 comment
Open

How to remove shared data key using rust? #301

leandrocurioso opened this issue Jan 31, 2025 · 1 comment

Comments

@leandrocurioso
Copy link

I am building a rust filter and using the shared data, I noticed that we have implementations of:

https://github.com/proxy-wasm/proxy-wasm-rust-sdk/blob/main/src/traits.rs#L32

get_shared_data and set_shared_data

I need a way to delete the key. I couldn't find a function do do that.

Can someone please share an example?

Thanks in advance!

@PiotrSikora
Copy link
Member

set_shared_data(key, None, None) can be used to delete the key, but knowing this is a low-level ABI detail and it shouldn't be leaked to the SDK, so I've added remove_shared_data() (#307).

Note that some hosts will remove the key (e.g. NGINX), while others will only remove the key's value (e.g. Envoy).

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

No branches or pull requests

2 participants