ratelimit

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2020 License: MIT Imports: 1 Imported by: 0

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