throttle

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMultiOperationMatch

func NewMultiOperationMatch(strs ...string) string

Types

type OperationLimiter

type OperationLimiter struct {
	Operation  string
	RefillRate rate.Limit
	Burst      int
	// contains filtered or unexported fields
}

func (*OperationLimiter) Match

func (o *OperationLimiter) Match(r *request.Request) (bool, error)

func (*OperationLimiter) Wait

func (o *OperationLimiter) Wait(r *request.Request) error

type ServiceLimiter

type ServiceLimiter []*OperationLimiter

func (ServiceLimiter) LimitRequest

func (s ServiceLimiter) LimitRequest(r *request.Request)

func (ServiceLimiter) ReviewResponse

func (s ServiceLimiter) ReviewResponse(r *request.Request)

type ServiceLimiters

type ServiceLimiters map[string]*ServiceLimiter

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL