Skip to content

Kuadrant/limitador

Folders and files

NameName
Last commit message
Last commit date

Latest commit

19fc2c2 · Sep 12, 2023
Aug 24, 2023
Sep 1, 2023
Sep 12, 2023
Sep 12, 2023
Mar 23, 2023
Jul 11, 2023
Sep 12, 2023
Jan 31, 2022
Sep 12, 2023
May 20, 2020
Jul 27, 2023
Oct 21, 2022

Repository files navigation

Limitador

Limitador GH Workflow docs.rs Crates.io Docker Repository on Quay codecov

Limitador is a generic rate-limiter written in Rust. It can be used as a library, or as a service. The service exposes HTTP endpoints to apply and observe limits. Limitador can be used with Envoy because it also exposes a grpc service, on a different port, that implements the Envoy Rate Limit protocol (v3).

Limitador is under active development, and its API has not been stabilized yet.

Getting started

Rust library

Add this to your Cargo.toml:

[dependencies]
limitador = { version = "0.3.0" }

For more information, see the README of the crate

Server

Run with Docker (replace latest with the version you want):

docker run --rm --net=host -it quay.io/kuadrant/limitador:v1.0.0

Run locally:

cargo run --release --bin limitador-server -- --help

Refer to the help message on how to start up the server. More information are available in the server's README.md

Development

Build

cargo build

Run the tests

Some tests need a redis deployed in localhost:6379. You can run it in Docker with:

docker run --rm -p 6379:6379 -it redis

Some tests need a infinispan deployed in localhost:11222. You can run it in Docker with:

docker run --rm -p 11222:11222 -it -e USER=username -e PASS=password infinispan/server:11.0.9.Final

Then, run the tests:

cargo test --all-features

or you can run tests disabling the "redis storage" feature:

cd limitador; cargo test --no-default-features

License

Apache 2.0 License