Back to godoc.org

Package ratelimit

v0.3.3
Latest Go to latest

The latest major version is .

Published: Jan 20, 2020 | License: MIT | Module: github.com/bilibili/kratos

Index

func DefaultAllowOpts

func DefaultAllowOpts() allowOptions

DefaultAllowOpts returns the default allow options.

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
)

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier