ratelimit

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2020 License: MIT Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

rate

项目简介

BBR 限流

编译环境

依赖包

编译执行

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultAllowOpts

func DefaultAllowOpts() allowOptions

DefaultAllowOpts returns the default allow options.

Types

type AllowOption

type AllowOption interface {
	Apply(*allowOptions)
}

AllowOptions allow options.

type DoneInfo

type DoneInfo struct {
	Err error
	Op  Op
}

DoneInfo done info.

type Limiter

type Limiter interface {
	Allow(ctx context.Context, opts ...AllowOption) (func(info DoneInfo), error)
}

Limiter limit interface.

type Op

type Op int

Op operations type.

const (
	// Success opertion type: success
	Success Op = iota
	// Ignore opertion type: ignore
	Ignore
	// Drop opertion type: drop
	Drop
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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