Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InhibitMatcher ¶
func NewMatchers ¶
func NewMatchers() ([]*InhibitMatcher, error)
func (*InhibitMatcher) Match ¶
func (m *InhibitMatcher) Match() (*InhibitWhere, error)
type InhibitRule ¶
type InhibitRule struct {
SourceMatchers []string `mapstructure:"source_matchers" json:"source_matchers"`
TargetMatchers []string `mapstructure:"target_matchers" json:"target_matchers"`
Equal []string `mapstructure:"equal" json:"equal"`
}
InhibitRule 抑制规则结构体
func NewInhibitRules ¶
func NewInhibitRules() ([]*InhibitRule, error)
type InhibitWhere ¶
type Matcher ¶
type Matcher struct {
Name string `json:"name"` // 标签名
Value string `json:"value"` // 标签值
Type string `json:"type"` // 操作符: =, !=, =~, !~
Equal []string
}
func ParseMatcher ¶
ParseMatcher 将字符串解析为 Matcher 结构体
func TransformStringsToMatchers ¶
TransformStringsToMatchers 批量转换字符串数组
func (*Matcher) GetCondition ¶
GetCondition 返回 GORM 的 Where 条件片段和参数 返回示例: ("alertname = ?", "节点磁盘空间不足") 或者针对 JSON: ("labels->>? = ?", "$.\"device\"", "eth0")
Click to show internal directories.
Click to hide internal directories.