mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 10:03:33 -06:00
33 lines
553 B
Go
33 lines
553 B
Go
|
package alerting
|
||
|
|
||
|
import "github.com/grafana/grafana/pkg/components/simplejson"
|
||
|
|
||
|
type AlertCondition interface {
|
||
|
Eval()
|
||
|
}
|
||
|
|
||
|
type QueryCondition struct {
|
||
|
Query AlertQuery
|
||
|
Reducer AlertReducerModel
|
||
|
Evaluator AlertEvaluatorModel
|
||
|
}
|
||
|
|
||
|
func (c *QueryCondition) Eval() {
|
||
|
}
|
||
|
|
||
|
type AlertReducerModel struct {
|
||
|
Type string
|
||
|
Params []interface{}
|
||
|
}
|
||
|
|
||
|
type AlertEvaluatorModel struct {
|
||
|
Type string
|
||
|
Params []interface{}
|
||
|
}
|
||
|
|
||
|
func NewQueryCondition(model *simplejson.Json) (*QueryCondition, error) {
|
||
|
condition := QueryCondition{}
|
||
|
|
||
|
return &condition, nil
|
||
|
}
|