项目作者: 3scale-labs

项目描述 :
Rate limiter
高级语言: Rust
项目地址: git://github.com/3scale-labs/limitador.git
创建时间: 2020-05-20T08:51:56Z
项目社区:https://github.com/3scale-labs/limitador

开源协议:Apache License 2.0

下载


Limitador

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

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:

  1. [dependencies]
  2. 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):

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

Run locally:

  1. 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

  1. cargo build

Run the tests

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

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

Then, run the tests:

  1. cargo test --all-features

or you can run tests disabling the “redis storage” feature:

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

Contributing

Join us on the #kuadrant channel in the Kubernetes Slack workspace,
for live discussions about the roadmap and more.

License

Apache 2.0 License

FOSSA Status