mirror of
https://github.com/grafana/grafana.git
synced 2024-11-29 12:14:08 -06:00
31 lines
724 B
Go
31 lines
724 B
Go
package historian
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/grafana/grafana-plugin-sdk-go/data"
|
|
"github.com/grafana/grafana/pkg/infra/log"
|
|
"github.com/grafana/grafana/pkg/services/ngalert/models"
|
|
"github.com/grafana/grafana/pkg/services/ngalert/state"
|
|
)
|
|
|
|
type SqlBackend struct {
|
|
log log.Logger
|
|
}
|
|
|
|
func NewSqlBackend() *SqlBackend {
|
|
return &SqlBackend{
|
|
log: log.New("ngalert.state.historian"),
|
|
}
|
|
}
|
|
|
|
func (h *SqlBackend) RecordStatesAsync(ctx context.Context, _ *models.AlertRule, _ []state.StateTransition) <-chan error {
|
|
errCh := make(chan error)
|
|
close(errCh)
|
|
return errCh
|
|
}
|
|
|
|
func (h *SqlBackend) QueryStates(ctx context.Context, query models.HistoryQuery) (*data.Frame, error) {
|
|
return data.NewFrame("states"), nil
|
|
}
|