Fastly Compute C++ SDK
Loading...
Searching...
No Matches
fastly::erl::ERL Class Reference

#include <erl.h>

Public Member Functions

 ERL (RateCounter rate_counter, PenaltyBox penalty_box)
tl::expected< bool, ERLErrorcheck_rate (std::string_view entry, std::uint32_t delta, RateWindow window, std::uint32_t limit, std::chrono::minutes ttl) const
const RateCounterrate_counter () const
const PenaltyBoxpenalty_box () const

Detailed Description

Examples
erl.cpp.

Constructor & Destructor Documentation

◆ ERL()

fastly::erl::ERL::ERL ( RateCounter rate_counter,
PenaltyBox penalty_box )
inline

Member Function Documentation

◆ check_rate()

tl::expected< bool, ERLError > fastly::erl::ERL::check_rate ( std::string_view entry,
std::uint32_t delta,
RateWindow window,
std::uint32_t limit,
std::chrono::minutes ttl ) const

Increment an entry in a rate counter and check if the client has exceeded some average number of requests per second (RPS) over the window. If the client is over the rps limit for the window, add to the penaltybox for ttl. Valid ttl span is 1m to 1h.

◆ penalty_box()

const PenaltyBox & fastly::erl::ERL::penalty_box ( ) const
inline

◆ rate_counter()

const RateCounter & fastly::erl::ERL::rate_counter ( ) const
inline

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