leaky_bucket

package
v0.0.0-...-d3fc627 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

* * *@author 吴昊轩 *@create 2019-11-2916:13

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LeakyBucket

type LeakyBucket struct {
	// contains filtered or unexported fields
}

func (*LeakyBucket) RateLimit

func (l *LeakyBucket) RateLimit() bool

type TokenBucket

type TokenBucket struct {
	Capacity    int64 // 桶的容量
	Rate        int64 // 令牌放入速度
	Tokens      int64 // 当前令牌数量
	RefreshTime int64
}

Jump to

Keyboard shortcuts

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