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

#include <erl.h>

Public Member Functions

 PenaltyBox (std::string name)
tl::expected< void, ERLErroradd (std::string_view entry, std::chrono::minutes ttl)
tl::expected< bool, ERLErrorhas (std::string_view entry) const
 Check if entry is in the penaltybox.
std::string_view name () const

Detailed Description

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.

Examples
erl.cpp.

Constructor & Destructor Documentation

◆ PenaltyBox()

fastly::erl::PenaltyBox::PenaltyBox ( std::string name)
inlineexplicit

Member Function Documentation

◆ add()

tl::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.

◆ has()

tl::expected< bool, ERLError > fastly::erl::PenaltyBox::has ( std::string_view entry) const

Check if entry is in the penaltybox.

◆ name()

std::string_view fastly::erl::PenaltyBox::name ( ) const
inline

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