unirate

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: MIT, Apache-2.0, BSD-2-Clause, + 4 more Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MaxQueuingTime *time.Duration `yaml:"maxQueuingTime" json:"maxQueuingTime"`
}

匀速排队限流器配置

func (*Config) SetDefault

func (c *Config) SetDefault()

设置默认值

func (*Config) Verify

func (c *Config) Verify() error

校验配置值

type RateLimiterUniformRate

type RateLimiterUniformRate struct {
	*plugin.PluginBase
	// contains filtered or unexported fields
}

基于匀速排队策略的限流控制器

func (*RateLimiterUniformRate) Destroy

func (g *RateLimiterUniformRate) Destroy() error

Destroy 销毁插件,可用于释放资源

func (*RateLimiterUniformRate) Init

Init 初始化插件

func (*RateLimiterUniformRate) InitQuota

初始化并创建限流窗口 主流程会在首次调用,以及规则对象变更的时候,调用该方法

func (*RateLimiterUniformRate) IsEnable

enable ?

func (*RateLimiterUniformRate) Name

func (g *RateLimiterUniformRate) Name() string

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

func (*RateLimiterUniformRate) Type

Type 插件类型

Jump to

Keyboard shortcuts

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