Documentation ¶
Index ¶
- type DoNothingBucket
- type RateLimiterReject
- func (g *RateLimiterReject) Destroy() error
- func (g *RateLimiterReject) Init(ctx *plugin.InitContext) error
- func (g *RateLimiterReject) InitQuota(criteria *ratelimiter.InitCriteria) (ratelimiter.QuotaBucket, error)
- func (g *RateLimiterReject) IsEnable(cfg config.Configuration) bool
- func (g *RateLimiterReject) Name() string
- func (g *RateLimiterReject) Type() common.Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DoNothingBucket ¶
type DoNothingBucket struct { }
空实现的bucket
func (*DoNothingBucket) GetQuota ¶
func (d *DoNothingBucket) GetQuota() (*ratelimiter.QuotaResult, error)
在令牌桶/漏桶中进行单个配额的划扣,并返回本次分配的结果
type RateLimiterReject ¶
type RateLimiterReject struct {
*plugin.PluginBase
}
基于直接拒绝策略的限流控制器
func (*RateLimiterReject) Destroy ¶
func (g *RateLimiterReject) Destroy() error
Destroy 销毁插件,可用于释放资源
func (*RateLimiterReject) Init ¶
func (g *RateLimiterReject) Init(ctx *plugin.InitContext) error
Init 初始化插件
func (*RateLimiterReject) InitQuota ¶
func (g *RateLimiterReject) InitQuota(criteria *ratelimiter.InitCriteria) (ratelimiter.QuotaBucket, error)
初始化并创建限流窗口 主流程会在首次调用,以及规则对象变更的时候,调用该方法
func (*RateLimiterReject) IsEnable ¶
func (g *RateLimiterReject) IsEnable(cfg config.Configuration) bool
enable
Click to show internal directories.
Click to hide internal directories.