Expand description

Tocket

This library provides implementation of token bucket algorithm and some storage implementations.

Available storages:

You can implement your own storage (e.g. Postgres).

Features

  • redis-impl - redis storage implementation
  • distributed-impl - distributed storage implementation

Re-exports

pub use in_memory::*;
pub use distributed::*;
distributed-impl
pub use in_redis::*;
redis-impl

Modules

distributeddistributed-impl
in_redisredis-impl

Structs

State of token bucket.

Rate limiter that implements token bucket algorithm.

Struct that implements token bucket algorithm.

Traits

Trait that provides function for tokens acquiring.