Documentation ¶
Index ¶
- func ComponentKey(component Component) string
- type ClassificationEngine
- type Classifier
- type ClassifierID
- type Component
- type ConcurrencyLimiter
- type Engine
- type FluxMeter
- type FluxMeterID
- type HTTPRequestPreview
- type LabelPreview
- type Limiter
- type LimiterID
- type Policy
- type PreviewBase
- type PreviewID
- type RateLimiter
- type RequestContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComponentKey ¶ added in v0.21.0
ComponentKey returns a unique Key for a component.
Types ¶
type ClassificationEngine ¶
type ClassificationEngine interface { RegisterClassifier(classifier Classifier) error UnregisterClassifier(classifier Classifier) error GetClassifier(classifierID ClassifierID) Classifier }
ClassificationEngine is the interface for registering classifiers.
type Classifier ¶
type Classifier interface { // GetFlowSelector returns the selector. GetFlowSelector() *policylangv1.FlowSelector // GetClassifierID returns ClassifierID object that should uniquely identify classifier. GetClassifierID() ClassifierID // GetRequestCounter returns the counter for the classifier. GetRequestCounter() prometheus.Counter }
Classifier interface.
type ClassifierID ¶
ClassifierID is the ID of the Classifier.
func (ClassifierID) String ¶
func (cID ClassifierID) String() string
String function returns the ClassifierID as a string.
type Component ¶
Component is the interface that wraps the GetPolicyName, GetPolicyHash, and GetComponentID methods.
type ConcurrencyLimiter ¶
type ConcurrencyLimiter interface { Limiter GetLatencyObserver(labels map[string]string) prometheus.Observer GetRequestCounter(labels map[string]string) prometheus.Counter }
ConcurrencyLimiter interface.
type Engine ¶
type Engine interface { ProcessRequest( ctx context.Context, requestContext RequestContext, ) *flowcontrolv1.CheckResponse RegisterConcurrencyLimiter(sa ConcurrencyLimiter) error UnregisterConcurrencyLimiter(sa ConcurrencyLimiter) error GetConcurrencyLimiter(limiterID LimiterID) ConcurrencyLimiter RegisterFluxMeter(fm FluxMeter) error UnregisterFluxMeter(fm FluxMeter) error GetFluxMeter(fluxMeterName string) FluxMeter RegisterRateLimiter(l RateLimiter) error UnregisterRateLimiter(l RateLimiter) error GetRateLimiter(limiterID LimiterID) RateLimiter RegisterLabelPreview(l LabelPreview) error UnregisterLabelPreview(l LabelPreview) error }
Engine is an interface for registering fluxmeters and schedulers.
type FluxMeter ¶
type FluxMeter interface { // GetSelector returns the selector GetFlowSelector() *policylangv1.FlowSelector // GetAttributeKey returns the attribute key GetAttributeKey() string // GetFluxMeterName returns the metric name GetFluxMeterName() string // GetFluxMeterID returns the flux meter ID GetFluxMeterID() FluxMeterID // GetHistogram returns the histogram observer for given labels. // It expects the following labels to be set: // * metrics.DecisionTypeLabel, // * metrics.ResponseStatusLabel, // * metrics.StatusCodeLabel, // * metrics.FeatureStatusLabel. GetHistogram(labels map[string]string) prometheus.Observer }
FluxMeter in an interface for interacting with fluxmeters.
type FluxMeterID ¶
type FluxMeterID struct {
FluxMeterName string
}
FluxMeterID is the ID of the FluxMeter.
func (FluxMeterID) String ¶
func (fmID FluxMeterID) String() string
String function returns the FluxMeterID as a string.
type HTTPRequestPreview ¶ added in v0.19.0
type HTTPRequestPreview interface { PreviewBase // AddHTTPRequestPreview adds labels to preview. AddHTTPRequestPreview(request map[string]interface{}) }
HTTPRequestPreview interface.
type LabelPreview ¶ added in v0.17.0
type LabelPreview interface { PreviewBase // AddLabelPreview adds labels to preview. AddLabelPreview(labels map[string]string) }
LabelPreview interface.
type Limiter ¶
type Limiter interface { GetPolicyName() string GetFlowSelector() *policylangv1.FlowSelector RunLimiter(ctx context.Context, labels map[string]string, tokens uint64) *flowcontrolv1.LimiterDecision GetLimiterID() LimiterID }
Limiter interface. Lifetime of this interface is per policy/component.
type PreviewBase ¶ added in v0.19.0
type PreviewBase interface { // GetPreviewID returns the ID of the preview. GetPreviewID() PreviewID // GetFlowSelector returns the flow selector. GetFlowSelector() *policylangv1.FlowSelector }
PreviewBase is the base interface for all preview requests.
type PreviewID ¶ added in v0.19.0
type PreviewID struct {
RequestID string
}
PreviewID is the ID of a preview.