rateLimit

package
v0.3.18 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 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   int   //每秒生成令牌数
	Consume  int   //每次请求消耗令牌数
	Capacity int   //令牌桶最大容量
	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