Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MetricType ¶
type MetricType int32
MetricType represents the target metric type.
const ( // Concurrency represents concurrency count. Concurrency MetricType = iota )
func (MetricType) String ¶
func (s MetricType) String() string
type Rule ¶
type Rule struct { // ID represents the unique ID of the rule (optional). ID string `json:"id,omitempty"` Resource string `json:"resource"` MetricType MetricType `json:"metricType"` Threshold uint32 `json:"threshold"` }
Rule describes the concurrency num control, that is similar to semaphore
func GetRules ¶
func GetRules() []Rule
GetRules returns all the rules based on copy. It doesn't take effect for isolation module if user changes the rule.
func GetRulesOfResource ¶
GetRulesOfResource returns specific resource's rules based on copy. It doesn't take effect for isolation module if user changes the rule.
func (*Rule) ResourceName ¶
type Slot ¶
type Slot struct { }
func (*Slot) Check ¶
func (s *Slot) Check(ctx *base.EntryContext) *base.TokenResult
Click to show internal directories.
Click to hide internal directories.