Documentation ¶
Index ¶
- Variables
- func CacheModule() fx.Option
- func EngineModule() fx.Option
- func Module() fx.Option
- func NewCache(dc *distcache.DistCache, lc fx.Lifecycle, pr *prometheus.Registry) (iface.Cache, error)
- func NewEngine(agentInfo *agentinfo.AgentInfo) iface.Engine
- func ProvideEngine(cache iface.Cache, agentInfo *agentinfo.AgentInfo) iface.Engine
- type Cache
- func (c *Cache) Delete(ctx context.Context, req *flowcontrolv1.CacheDeleteRequest) *flowcontrolv1.CacheDeleteResponse
- func (c *Cache) Lookup(ctx context.Context, request *flowcontrolv1.CacheLookupRequest) *flowcontrolv1.CacheLookupResponse
- func (c *Cache) LookupGlobal(ctx context.Context, request *flowcontrolv1.CacheLookupRequest) map[string]*flowcontrolv1.KeyLookupResponse
- func (c *Cache) LookupGlobalNoWait(ctx context.Context, request *flowcontrolv1.CacheLookupRequest) (map[string]*flowcontrolv1.KeyLookupResponse, *sync.WaitGroup)
- func (c *Cache) LookupNoWait(ctx context.Context, request *flowcontrolv1.CacheLookupRequest) (*flowcontrolv1.CacheLookupResponse, *sync.WaitGroup, *sync.WaitGroup)
- func (c *Cache) LookupResult(ctx context.Context, request *flowcontrolv1.CacheLookupRequest) *flowcontrolv1.KeyLookupResponse
- func (c *Cache) LookupResultNoWait(ctx context.Context, request *flowcontrolv1.CacheLookupRequest) (*flowcontrolv1.KeyLookupResponse, *sync.WaitGroup)
- func (c *Cache) Upsert(ctx context.Context, req *flowcontrolv1.CacheUpsertRequest) *flowcontrolv1.CacheUpsertResponse
- type Engine
- func (e *Engine) FlowEnd(ctx context.Context, request *flowcontrolv1.FlowEndRequest) *flowcontrolv1.FlowEndResponse
- func (e *Engine) GetAgentInfo() *agentinfo.AgentInfo
- func (e *Engine) GetFlowEnder(limiterID iface.LimiterID) iface.FlowEnder
- func (e *Engine) GetFluxMeter(fluxMeterName string) iface.FluxMeter
- func (e *Engine) GetRateLimiter(limiterID iface.LimiterID) iface.Limiter
- func (e *Engine) GetSampler(limiterID iface.LimiterID) iface.Limiter
- func (e *Engine) GetScheduler(limiterID iface.LimiterID) iface.Scheduler
- func (e *Engine) ProcessRequest(ctx context.Context, requestContext iface.RequestContext) (response *flowcontrolv1.CheckResponse)
- func (e *Engine) RegisterCache(cache iface.Cache)
- func (e *Engine) RegisterConcurrencyLimiter(cl iface.ConcurrencyLimiter) error
- func (e *Engine) RegisterConcurrencyScheduler(cl iface.ConcurrencyScheduler) error
- func (e *Engine) RegisterFluxMeter(fm iface.FluxMeter) error
- func (e *Engine) RegisterLabelPreview(lp iface.LabelPreview) error
- func (e *Engine) RegisterRateLimiter(rl iface.Limiter) error
- func (e *Engine) RegisterSampler(l iface.Limiter) error
- func (e *Engine) RegisterScheduler(cl iface.Scheduler) error
- func (e *Engine) UnregisterConcurrencyLimiter(cl iface.ConcurrencyLimiter) error
- func (e *Engine) UnregisterConcurrencyScheduler(cl iface.ConcurrencyScheduler) error
- func (e *Engine) UnregisterFluxMeter(fm iface.FluxMeter) error
- func (e *Engine) UnregisterLabelPreview(lp iface.LabelPreview) error
- func (e *Engine) UnregisterRateLimiter(rl iface.Limiter) error
- func (e *Engine) UnregisterSampler(rl iface.Limiter) error
- func (e *Engine) UnregisterScheduler(cl iface.Scheduler) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrCacheKeyEmpty is the error returned when the cache key is empty. ErrCacheKeyEmpty = errors.New("cache key cannot be empty") // ErrCacheControlPointEmpty is the error returned when the cache control point is empty. ErrCacheControlPointEmpty = errors.New("cache control_point cannot be empty") // ErrCacheNotReady is the error returned when the cache is not ready to be used. ErrCacheNotReady = errors.New("cache is not ready") // ErrCacheKeyNotFound is the error returned when the key is not found in the cache. This is copied from the internal olric package. ErrCacheKeyNotFound = errors.New("key not found") )
Functions ¶
func CacheModule ¶ added in v2.24.0
CacheModule returns the fx options for the cache.
func EngineModule ¶ added in v2.24.0
EngineModule returns the fx options for the engine.
Types ¶
type Cache ¶ added in v2.24.0
type Cache struct {
// contains filtered or unexported fields
}
Cache for saving responses at flow end.
func (*Cache) Delete ¶ added in v2.24.0
func (c *Cache) Delete(ctx context.Context, req *flowcontrolv1.CacheDeleteRequest) *flowcontrolv1.CacheDeleteResponse
Delete deletes the cache for the given CacheDeleteRequest.
func (*Cache) Lookup ¶ added in v2.25.0
func (c *Cache) Lookup(ctx context.Context, request *flowcontrolv1.CacheLookupRequest) *flowcontrolv1.CacheLookupResponse
Lookup looks up the cache for the given CacheLookupRequest.
func (*Cache) LookupGlobal ¶ added in v2.29.3
func (c *Cache) LookupGlobal(ctx context.Context, request *flowcontrolv1.CacheLookupRequest) map[string]*flowcontrolv1.KeyLookupResponse
LookupGlobal looks up the global caches for the given CacheLookupRequest.
func (*Cache) LookupGlobalNoWait ¶ added in v2.29.3
func (c *Cache) LookupGlobalNoWait(ctx context.Context, request *flowcontrolv1.CacheLookupRequest) (map[string]*flowcontrolv1.KeyLookupResponse, *sync.WaitGroup)
LookupGlobalNoWait looks up the global caches for the given CacheLookupRequest without waiting for the result.
func (*Cache) LookupNoWait ¶ added in v2.29.3
func (c *Cache) LookupNoWait(ctx context.Context, request *flowcontrolv1.CacheLookupRequest) (*flowcontrolv1.CacheLookupResponse, *sync.WaitGroup, *sync.WaitGroup)
LookupNoWait looks up the cache for the given CacheLookupRequest.
func (*Cache) LookupResult ¶ added in v2.29.3
func (c *Cache) LookupResult(ctx context.Context, request *flowcontrolv1.CacheLookupRequest) *flowcontrolv1.KeyLookupResponse
LookupResult looks up the result cache for the given CacheLookupRequest.
func (*Cache) LookupResultNoWait ¶ added in v2.29.3
func (c *Cache) LookupResultNoWait(ctx context.Context, request *flowcontrolv1.CacheLookupRequest) (*flowcontrolv1.KeyLookupResponse, *sync.WaitGroup)
LookupResultNoWait looks up the result cache for the given CacheLookupRequest without waiting for the result.
func (*Cache) Upsert ¶ added in v2.24.0
func (c *Cache) Upsert(ctx context.Context, req *flowcontrolv1.CacheUpsertRequest) *flowcontrolv1.CacheUpsertResponse
Upsert upserts the cache for the given CacheUpsertRequest.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine APIs to (1) Get schedulers given a service, control point and set of labels. (2) Get flux meter histogram given a metric id.
func (*Engine) FlowEnd ¶ added in v2.29.0
func (e *Engine) FlowEnd(ctx context.Context, request *flowcontrolv1.FlowEndRequest) *flowcontrolv1.FlowEndResponse
FlowEnd implements Engine.FlowEnd.
func (*Engine) GetAgentInfo ¶
GetAgentInfo returns the agent info.
func (*Engine) GetFlowEnder ¶ added in v2.29.0
GetFlowEnder Lookup function for getting a flow ender.
func (*Engine) GetFluxMeter ¶
GetFluxMeter Lookup function for getting flux meter.
func (*Engine) GetRateLimiter ¶
GetRateLimiter Lookup function for getting rate limiter.
func (*Engine) GetSampler ¶ added in v2.5.0
GetSampler Lookup function for getting sampler.
func (*Engine) GetScheduler ¶ added in v2.2.0
GetScheduler Lookup function for getting scheduler.
func (*Engine) ProcessRequest ¶
func (e *Engine) ProcessRequest(ctx context.Context, requestContext iface.RequestContext) (response *flowcontrolv1.CheckResponse)
ProcessRequest implements Engine.ProcessRequest.
func (*Engine) RegisterCache ¶ added in v2.24.0
RegisterCache .
func (*Engine) RegisterConcurrencyLimiter ¶ added in v2.29.0
func (e *Engine) RegisterConcurrencyLimiter(cl iface.ConcurrencyLimiter) error
RegisterConcurrencyLimiter adds limiter actuator to multimatcher and flow enders.
func (*Engine) RegisterConcurrencyScheduler ¶ added in v2.29.0
func (e *Engine) RegisterConcurrencyScheduler(cl iface.ConcurrencyScheduler) error
RegisterConcurrencyScheduler adds limiter actuator to multimatcher and registers the flow ender.
func (*Engine) RegisterFluxMeter ¶
RegisterFluxMeter adds fluxmeter to histogram map and multimatcher.
func (*Engine) RegisterLabelPreview ¶
func (e *Engine) RegisterLabelPreview(lp iface.LabelPreview) error
RegisterLabelPreview adds label preview to multimatcher.
func (*Engine) RegisterRateLimiter ¶
RegisterRateLimiter adds limiter actuator to multimatcher.
func (*Engine) RegisterSampler ¶ added in v2.5.0
RegisterSampler adds limiter actuator to multimatcher.
func (*Engine) RegisterScheduler ¶ added in v2.2.0
RegisterScheduler adds scheduler to multimatcher.
func (*Engine) UnregisterConcurrencyLimiter ¶ added in v2.29.0
func (e *Engine) UnregisterConcurrencyLimiter(cl iface.ConcurrencyLimiter) error
UnregisterConcurrencyLimiter removes limiter actuator from multimatcher and flow enders.
func (*Engine) UnregisterConcurrencyScheduler ¶ added in v2.29.0
func (e *Engine) UnregisterConcurrencyScheduler(cl iface.ConcurrencyScheduler) error
UnregisterConcurrencyScheduler removes limiter actuator from multimatcher and flow enders.
func (*Engine) UnregisterFluxMeter ¶
UnregisterFluxMeter removes fluxmeter from histogram map and multimatcher.
func (*Engine) UnregisterLabelPreview ¶
func (e *Engine) UnregisterLabelPreview(lp iface.LabelPreview) error
UnregisterLabelPreview removes label preview from multimatcher.
func (*Engine) UnregisterRateLimiter ¶
UnregisterRateLimiter removes limiter actuator from multimatcher.
func (*Engine) UnregisterSampler ¶ added in v2.5.0
UnregisterSampler removes limiter actuator from multimatcher.
Directories ¶
Path | Synopsis |
---|---|
resources
|
|
Companion package for github.com/fluxninja/aperture/api/gen/proto/go/aperture/policy/language/v1 containing conversions of proto-generated struct into golang ones and other helpers.
|
Companion package for github.com/fluxninja/aperture/api/gen/proto/go/aperture/policy/language/v1 containing conversions of proto-generated struct into golang ones and other helpers. |
preview/config
+kubebuilder:validation:Optional
|
+kubebuilder:validation:Optional |