reject

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2022 License: Apache-2.0, Apache-2.0, BSD-2-Clause, + 4 more Imports: 5 Imported by: 0

Documentation

Index

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)

在令牌桶/漏桶中进行单个配额的划扣,并返回本次分配的结果

func (*DoNothingBucket) Release

func (d *DoNothingBucket) Release()

释放配额(仅对于并发数限流有用)

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 (*RateLimiterReject) IsEnable

func (g *RateLimiterReject) IsEnable(cfg config.Configuration) bool

enable

func (*RateLimiterReject) Name

func (g *RateLimiterReject) Name() string

Name 插件名,一个类型下插件名唯一

func (*RateLimiterReject) Type

func (g *RateLimiterReject) Type() common.Type

Type 插件类型

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL