request

package
v0.22.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: Apache-2.0 Imports: 2 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StorageObjectCountTracker added in v0.23.0

type StorageObjectCountTracker interface {
	// OnCount is invoked to update the current number of total
	// objects for the given resource
	OnCount(string, int64)

	// Get returns the total number of objects for the given resource.
	// If the given resource is not being tracked Get will return zero.
	// For now, we do not differentiate between zero object count and
	// a given resoure not being present.
	Get(string) int64
}

StorageObjectCountTracker is an interface that is used to keep track of of the total number of objects for each resource. {group}.{resource} is used as the key name to update and retrieve the total number of objects for a given resource.

func NewStorageObjectCountTracker added in v0.23.0

func NewStorageObjectCountTracker() StorageObjectCountTracker

NewStorageObjectCountTracker returns an instance of StorageObjectCountTracker interface that can be used to keep track of the total number of objects for each resource.

type Width

type Width struct {
	// Seats represents the number of seats associated with this request
	Seats uint
}

func DefaultWidthEstimator

func DefaultWidthEstimator(_ *http.Request) Width

DefaultWidthEstimator returns returns '1' as the "width" of the given request.

TODO: when we plumb in actual "width" handling for different

type of request(s) this function will iterate through a chain
of widthEstimator instance(s).

type WidthEstimatorFunc

type WidthEstimatorFunc func(*http.Request) Width

WidthEstimatorFunc returns the estimated "width" of a given request. This function will be used by the Priority & Fairness filter to estimate the "width" of incoming requests.

func (WidthEstimatorFunc) EstimateWidth

func (e WidthEstimatorFunc) EstimateWidth(r *http.Request) Width

Jump to

Keyboard shortcuts

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