• Oran Agra's avatar
    Add module API flag for using enum configs as bit flags (#10643) · 81926254
    Oran Agra authored
    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`.
    81926254
redismodule.h 88.7 KB