ratelimit

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

README

rate

项目简介

BBR 限流

编译环境

依赖包

编译执行

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Allow

type Allow struct{}

Allow allow options.

func DefaultAllowOpts

func DefaultAllowOpts() Allow

DefaultAllowOpts returns the default allow options.

type AllowOption

type AllowOption interface {
	Apply(*Allow)
}

AllowOption some option of Allow

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