rateLimit

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Set

func Set(c *RateLimit)

Types

type RateLimit

type RateLimit struct {
	Create   int32 //每秒生成令牌数
	Consume  int32 //每次请求消耗令牌数
	Capacity int32 //令牌桶最大容量
	IdleTime int64 //闲置时长(s)
}

func Get

func Get() *RateLimit

Jump to

Keyboard shortcuts

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