coolephp/rate-limiter

Provides a Token Bucket implementation to rate limit input and output in your Coole application. - 提供令牌桶实现来限制 Coole 应用程序中的输入和输出。

v1.0.1 2021-06-05 08:34 UTC

This package is auto-updated.

Last update: 2024-12-05 19:32:27 UTC


README

简体中文 | ENGLISH

Provides a Token Bucket implementation to rate limit input and output in your Coole application. - 提供令牌桶实现来限制 Coole 应用程序中的输入和输出。

Tests Check & fix styling codecov Latest Stable Version Total Downloads License

Requirement

  • PHP >= 7.2

Installation

$ composer require coolephp/rate-limiter --prefer-dist -vvv

Usage

  1. Copy rate-limiter/config/rate-limiter.php to coole-skeleton/config/rate-limiter.php.
  2. Config \Coole\RateLimiter\RateLimiter::class middleware.
<?php

return [
    /*
     * App 名称
     */
    'name' => env('APP_NAME', 'Coole'),

    /*
     * 全局中间件
     */
    'middleware' => [
        ...
        \Coole\RateLimiter\RateLimiter::class
        ...
    ],
];

product

develop

Testing

$ composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.