Documentation
¶
Index ¶
Constants ¶
View Source
const (
RuleCheckSlotName = "sentinel-core-isolation-rule-check-slot"
)
Variables ¶
View Source
var (
DefaultSlot = &Slot{}
)
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 ¶
Click to show internal directories.
Click to hide internal directories.