Skip to content

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

License

Notifications You must be signed in to change notification settings

coolephp/rate-limiter

Repository files navigation

rate-limiter

简体中文 | 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.

About

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

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages