kratos: github.com/bilibili/kratos/pkg/ratelimit Index | Files | Directories

package ratelimit

import "github.com/bilibili/kratos/pkg/ratelimit"

Index

Package Files

limiter.go

func DefaultAllowOpts Uses

func DefaultAllowOpts() allowOptions

DefaultAllowOpts returns the default allow options.

type AllowOption Uses

type AllowOption interface {
    Apply(*allowOptions)
}

AllowOptions allow options.

type DoneInfo Uses

type DoneInfo struct {
    Err error
    Op  Op
}

DoneInfo done info.

type Limiter Uses

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

Limiter limit interface.

type Op Uses

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

PathSynopsis
bbr

Package ratelimit imports 1 packages (graph) and is imported by 3 packages. Updated 2019-10-23. Refresh now. Tools for package owners.