routerconcurrency

package
v0.0.0-...-7f5b3d9 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLimiter

func GetLimiter() *rcLimiter

GetLimiter 获取路由并发限制器

func InitLimiter

func InitLimiter(routers []elton.RouterInfo)

InitLimiter 初始路由并发限制

func List

func List() map[string]uint32

List 获取路由并发限制数

func Update

func Update(arr []string)

Update 更新路由并发数

Types

type RouterConcurrency

type RouterConcurrency struct {
	Router string `json:"router"`
	Max    uint32 `json:"max"`
	// 频率限制
	Rate int `json:"rate"`
	// 间隔
	Interval string `json:"interval"`
	// contains filtered or unexported fields
}

RouterConcurrency 路由并发配置

func (*RouterConcurrency) Take

func (rc *RouterConcurrency) Take()

Take 执行一次频率限制,此执行会根据当时频率延时

Jump to

Keyboard shortcuts

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