feat(alerting): add interface for alert backend

This commit is contained in:
bergquist 2016-06-02 16:34:25 +02:00
parent 69229211b2
commit 0bea0cc5b9

View File

@ -2,9 +2,16 @@ package graphite
import (
"fmt"
m "github.com/grafana/grafana/pkg/models"
)
// AlertDatasource is bacon
type AlertDatasource interface {
GetSeries(job *m.AlertJob) (m.TimeSeriesSlice, error)
}
// GetSeries returns timeseries data from the datasource
func GetSeries(job *m.AlertJob) (m.TimeSeriesSlice, error) {
if job.Datasource.Type == m.DS_GRAPHITE {
return GraphiteClient{}.GetSeries(job)