package
1.0.6
Repository: https://github.com/liuhailove/gmiter.git
Documentation: pkg.go.dev

# Functions

No description provided by the author
ClearRules clears all the rules in flow module.
ClearRulesOfResource clears resource level rules in flow module.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
GetRules returns all the rules based on copy.
GetRulesOfResource returns specific resource's rules based on copy.
No description provided by the author
No description provided by the author
IsValidRule 校验给定的规则是否何方.
LoadRules loads the given flow rules to the rule manager, while all previous rules will be replaced.
LoadRulesOfResource loads the given resource's flow rules to the rule manager, while all previous resource's rules will be replaced.
NewClusterMetric 新建集群Metric.
NewClusterMetricWithCheck 新建集群Metric.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewRequestLimiter 构造请求Limiter.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SetTrafficShapingGenerator sets the traffic controller generator for the given TokenCalculateStrategy and ControlBehavior.

# Constants

No description provided by the author
AssociatedResource 表示由关联资源而不是当前资源进行流量控制。.
No description provided by the author
CurrentResource 表示直接通过当前资源进行流量控制。.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Throttling 表示挂起的请求将被限制,在队列中等待(直到有可用容量).
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

DefaultDowngradeIntervalInNs 默认降级2s.
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

ClusterConfig 集群流控配置.
ClusterMetric 集群Metric.
DefaultClusterTokenClient 默认TokenClient.
DefaultTokenService 默认TokenService集群实现.
No description provided by the author
MemoryAdaptiveTrafficShapingCalculator is a memory adaptive traffic shaping calculator adaptive flow control algorithm If the watermark is less than Rule.MemLowWaterMarkBytes, the threshold is Rule.LowMemUsageThreshold.
No description provided by the author
No description provided by the author
Rule 描述流控策略,流控策略基于QPS统计指标.
No description provided by the author
No description provided by the author
ThrottlingChecker limits the time interval between two requests.
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author
TrafficShapingCalculator calculates the actual traffic shaping threshold based on the threshold of rule and the traffic shaping strategy.
TrafficShapingChecker performs checking according to current metrics and the traffic shaping strategy, then yield the token result.

# Type aliases

ClusterStrategy 集群策略.
ControlBehavior 定义请求达到资源容量时的行为。.
RelationStrategy 表示基于调用关系的流控策略。.
ResourceClusterMap 资源->clusterMetric Map.
No description provided by the author
TokenServerStrategy TokenServer策略.
TrafficControllerGenFunc represents the TrafficShapingController generator function of a specific control behavior.
TrafficControllerIdMap key为ruleId,value为Metric.
TrafficControllerMap represents the map storage for TrafficShapingController.