valkey-io / valkeymodule-rs

Rust valkey SDK for modules
BSD 3-Clause "New" or "Revised" License
32 stars 10 forks source link

Support for implementing digest Module type callback using existing Module APIs #97

Open KarthikSubbarao opened 2 months ago

KarthikSubbarao commented 2 months ago

The Module data types provide a callback for digest and this is called when the DEBUG command is used on the module object for developing and testing for correctness. For modules to implement the digest callback, we will need wrapper functions in the valkeymodule-rs SDK written around the following existing Module APIs:

ValkeyModule_DigestAddStringBuffer
ValkeyModule_DigestAddLongLong
ValkeyModule_DigestEndSequence
ValkeyModule_GetKeyNameFromDigest
ValkeyModule_GetDbIdFromDigest

Example Valkey Module in C implementing the digest callback: https://github.com/valkey-io/valkey/blob/unstable/tests/modules/datatype2.c#L614-L634

hahnandrew commented 2 months ago

Hey @KarthikSubbarao, happy to pick this up :slightly_smiling_face: