flowcontrol

package
v0.0.0-...-43b7830 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LocalFlowControls  = "local"
	RemoteFlowControls = "remote"
)

Variables

View Source
var (
	DefaultFlowControl = NewFlowControl(proxyv1alpha1.FlowControlSchema{
		Name: "system-default",
		FlowControlSchemaConfiguration: proxyv1alpha1.FlowControlSchemaConfiguration{
			Exempt: &proxyv1alpha1.ExemptFlowControlSchema{},
		},
	})
)

Functions

Types

type FlowControl

type FlowControl interface {
	// TryAcquire returns true if a token is taken immediately. Otherwise, it returns false.
	TryAcquire() bool
	// Release add a token back to the lock
	Release()
	// Resize changes the max in flight lock's capacity
	Resize(n uint32, burst uint32) bool
	// String returns human readable string.
	String() string
	// Type return flow control type
	Type() proxyv1alpha1.FlowControlSchemaType
}

func NewFlowControl

func NewFlowControl(schema proxyv1alpha1.FlowControlSchema) FlowControl

type MaxInflightFlowControl

type MaxInflightFlowControl interface {
	FlowControl
	MaxInflight() int32
}

type TokenBucketFlowControl

type TokenBucketFlowControl interface {
	FlowControl
	QPS() int32
	Burst() int32
}

Jump to

Keyboard shortcuts

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