ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches
rate_limiter_backend_ops_t Struct Reference

Backend callbacks implementing rate-limit checks, recording, cleanup, and destruction. More...

#include <include/ascii-chat/network/rate_limit/rate_limit.h>

Data Fields

asciichat_error_t(* check )(void *backend_data, const char *ip_address, rate_event_type_t event_type, const rate_limit_config_t *config, bool *allowed)
asciichat_error_t(* record )(void *backend_data, const char *ip_address, rate_event_type_t event_type)
asciichat_error_t(* cleanup )(void *backend_data, uint32_t max_age_secs)
void(* destroy )(void *backend_data)

Detailed Description

Backend callbacks implementing rate-limit checks, recording, cleanup, and destruction.

The public limiter keeps this table alongside opaque backend data, so the same API can use the in-memory hash table or the SQLite event store without exposing either implementation's state.

Definition at line 96 of file rate_limit.h.

Field Documentation

◆ check

asciichat_error_t(* rate_limiter_backend_ops_t::check) (void *backend_data, const char *ip_address, rate_event_type_t event_type, const rate_limit_config_t *config, bool *allowed)

Definition at line 97 of file rate_limit.h.

Referenced by rate_limiter_check().

◆ cleanup

asciichat_error_t(* rate_limiter_backend_ops_t::cleanup) (void *backend_data, uint32_t max_age_secs)

Definition at line 101 of file rate_limit.h.

Referenced by rate_limiter_prune().

◆ destroy

void(* rate_limiter_backend_ops_t::destroy) (void *backend_data)

Definition at line 103 of file rate_limit.h.

Referenced by rate_limiter_destroy().

◆ record

asciichat_error_t(* rate_limiter_backend_ops_t::record) (void *backend_data, const char *ip_address, rate_event_type_t event_type)

Definition at line 99 of file rate_limit.h.

Referenced by rate_limiter_record().


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