Skip to content

Commit

Permalink
Merge pull request #698 from 3scale/adapt-rate-limit-example-to-new-c…
Browse files Browse the repository at this point in the history
…onfig

Adapt rate limit policy example config to the new config schema
  • Loading branch information
mikz authored May 11, 2018
2 parents 0a110cc + d4c2bc9 commit c32ba83
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions examples/policies/rate_limit_configuration.lua
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
local policy_chain = require('apicast.policy_chain').default()

local rate_limit_policy = require('apicast.policy.rate_limit').new({
limiters = {
{
name = "connections",
key = {name = "limit1"},
conn = 20,
burst = 10,
delay = 0.5
connection_limiters = {
{
key = {name = "limit1"},
conn = 20,
burst = 10,
delay = 0.5
}
},
{
name = "leaky_bucket",
key = {name = "limit2"},
rate = 18,
burst = 9
leaky_bucket_limiters = {
{
key = {name = "limit2"},
rate = 18,
burst = 9
}
},
fixed_window_limiters = {
{
key = {name = "limit3"},
count = 10,
window = 10
}
},
{
name = "fixed_window",
key = {name = "limit3"},
count = 10,
window = 10
}},
redis_url = "redis://localhost:6379/1"
})

Expand Down

0 comments on commit c32ba83

Please sign in to comment.