PenaltyBox
Include fastly/erl.h to use this class.
A penalty box that can be used with the edge rate limiter or stand alone for adding and checking if some entry is in the data set.
Constructor
explicit fastly::erl::PenaltyBox::PenaltyBox(std::string name)Parameters
- name: std::string
Methods
add
View sourcetl::expected<void, ERLError> fastly::erl::PenaltyBox::add(std::string_view entry, std::chrono::minutes ttl)Add entry to a the penaltybox for the duration of ttl. Valid ttl span is 1m to 1h.
Parameters
- entry: std::string_view
- ttl: std::chrono::minutes
Returns
tl::expected<void, ERLError>
has
View sourceCheck if entry is in the penaltybox.
Parameters
- entry: std::string_view
Returns
tl::expected<bool, ERLError>