README

rate

项目简介

BBR 限流

编译环境

依赖包

编译执行

Expand ▾ Collapse ▴

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
)

Source Files

Directories

Path Synopsis
bbr