Documentation ¶
Index ¶
- Constants
- Variables
- func GetFlowControlTypeFromLimitItem(config proxyv1alpha1.LimitItemDetail) proxyv1alpha1.FlowControlSchemaType
- func GuessFlowControlSchemaType(config proxyv1alpha1.FlowControlSchema) proxyv1alpha1.FlowControlSchemaType
- type FlowControl
- type MaxInflightFlowControl
- type TokenBucketFlowControl
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 ¶
func GetFlowControlTypeFromLimitItem ¶
func GetFlowControlTypeFromLimitItem(config proxyv1alpha1.LimitItemDetail) proxyv1alpha1.FlowControlSchemaType
func GuessFlowControlSchemaType ¶
func GuessFlowControlSchemaType(config proxyv1alpha1.FlowControlSchema) proxyv1alpha1.FlowControlSchemaType
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 }
Click to show internal directories.
Click to hide internal directories.