PlugAttack.Storage.Ets (plug_attack v0.4.3)
Storage solution for PlugAttack using a local ets table.
Usage
You need to start the process in your supervision tree, for example:
children = [
# ...
worker(PlugAttack.Storage.Ets, [MyApp.PlugAttackStorage])
]
This will later allow you to pass the :storage
option to various rules
as storage: {PlugAttack.Storage.Ets, MyApp.PlugAttackStorage}
Link to this section Summary
Link to this section Functions
Link to this function
clean(name)
Forcefully clean the storage.
Link to this function
start_link(name, opts \\ [])
Starts the storage table and cleaner process.
The process is registered under name
and a public, named ets table
with that name is created as well.
Options
:clean_period
- how often the ets table should be cleaned of stale data. The key scheme guarantees stale data won't be used for making decisions. This is only about limiting memory consumption (default: 5000 ms).