Documentation
¶
Index ¶
- func ComponentID(component Component) string
- func ComponentIDExpanded(policyName string, componentIndex int64, policyHash string) string
- type ClassificationEngine
- type Classifier
- type ClassifierID
- type Component
- type ConcurrencyLimiter
- type Engine
- type FluxMeter
- type FluxMeterID
- type Limiter
- type LimiterID
- type Policy
- type RateLimiter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComponentID ¶
ComponentID returns the ID for a component.
Types ¶
type ClassificationEngine ¶ added in v0.5.0
type ClassificationEngine interface { RegisterClassifier(classifier Classifier) error UnregisterClassifier(classifier Classifier) error GetClassifier(classifierID ClassifierID) Classifier }
ClassificationEngine is the interface for registering classifiers.
type Classifier ¶ added in v0.1.2
type Classifier interface { // GetSelector returns the selector. GetSelector() *policylangv1.Selector // 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 ¶ added in v0.1.2
ClassifierID is the ID of the Classifier.
func (ClassifierID) String ¶ added in v0.1.2
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 GetComponentIndex methods.
type ConcurrencyLimiter ¶ added in v0.5.0
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, controlPoint selectors.ControlPoint, serviceIDs []string, labels map[string]string, ) *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 }
Engine is an interface for registering fluxmeters and schedulers.
type FluxMeter ¶
type FluxMeter interface { // GetSelector returns the selector GetSelector() *policylangv1.Selector // 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 Limiter ¶
type Limiter interface { GetPolicyName() string GetSelector() *policylangv1.Selector RunLimiter(ctx context.Context, labels map[string]string) *flowcontrolv1.LimiterDecision GetLimiterID() LimiterID }
Limiter interface. Lifetime of this interface is per policy/component.