diff options
author | Oran Agra <oran@redislabs.com> | 2022-04-26 20:29:20 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-26 20:29:20 +0300 |
commit | 81926254586f64fc6a9b393bf9afb0d2eacc5234 (patch) | |
tree | 51e28f518fc8f6219fd82395f76df3266b5ed3d1 /deps/lua/src/lvm.c | |
parent | 46ec6ad98e6d118bd98a447dcd2307e80bb0fcd6 (diff) | |
download | redis-81926254586f64fc6a9b393bf9afb0d2eacc5234.tar.gz |
Add module API flag for using enum configs as bit flags (#10643)
Enables registration of an enum config that'll let the user pass multiple keywords that
will be combined with `|` as flags into the integer config value.
```
const char *enum_vals[] = {"none", "one", "two", "three"};
const int int_vals[] = {0, 1, 2, 4};
if (RedisModule_RegisterEnumConfig(ctx, "flags", 3, REDISMODULE_CONFIG_DEFAULT | REDISMODULE_CONFIG_BITFLAGS, enum_vals, int_vals, 4, getFlagsConfigCommand, setFlagsConfigCommand, NULL, NULL) == REDISMODULE_ERR) {
return REDISMODULE_ERR;
}
```
doing:
`config set moduleconfigs.flags "two three"` will result in 6 being passed to`setFlagsConfigCommand`.
Diffstat (limited to 'deps/lua/src/lvm.c')
0 files changed, 0 insertions, 0 deletions