cwist
Modern C web framework with libttak runtime
Loading...
Searching...
No Matches
cwist_rate_limit_redis_cfg_t Struct Reference

Redis-backed rate limiter configuration. Strings are copied. More...

#include <middleware.h>

Public Attributes

cwist_redis_pool_t * pool
 
int requests_per_minute
 
const char * key_prefix
 
unsigned timeout_ms
 
bool fail_closed
 

Detailed Description

Redis-backed rate limiter configuration. Strings are copied.

Definition at line 31 of file middleware.h.

Member Data Documentation

◆ fail_closed

bool cwist_rate_limit_redis_cfg_t::fail_closed

False: allow on backend error; true: return 503.

Definition at line 36 of file middleware.h.

Referenced by cwist_mw_rate_limit_ip_redis().

◆ key_prefix

const char* cwist_rate_limit_redis_cfg_t::key_prefix

Default "cwist:rl:"; at most 128 bytes.

Definition at line 34 of file middleware.h.

Referenced by cwist_mw_rate_limit_ip_redis().

◆ pool

cwist_redis_pool_t* cwist_rate_limit_redis_cfg_t::pool

Borrowed; must outlive all middleware calls.

Definition at line 32 of file middleware.h.

Referenced by cwist_mw_rate_limit_ip_redis().

◆ requests_per_minute

int cwist_rate_limit_redis_cfg_t::requests_per_minute

Positive shared limit per IP and window.

Definition at line 33 of file middleware.h.

Referenced by cwist_mw_rate_limit_ip_redis().

◆ timeout_ms

unsigned cwist_rate_limit_redis_cfg_t::timeout_ms

Total Redis I/O budget; zero selects 50 ms, max 60000.

Definition at line 35 of file middleware.h.

Referenced by cwist_mw_rate_limit_ip_redis().


The documentation for this struct was generated from the following file: