mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* Create writer interface for recording rules Also create fake impl + use it for stub in scheduler
21 lines
476 B
Go
21 lines
476 B
Go
package writer
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"github.com/grafana/grafana-plugin-sdk-go/data"
|
|
)
|
|
|
|
type FakeWriter struct {
|
|
WriteFunc func(ctx context.Context, name string, t time.Time, frames data.Frames, extraLabels map[string]string) error
|
|
}
|
|
|
|
func (w FakeWriter) Write(ctx context.Context, name string, t time.Time, frames data.Frames, extraLabels map[string]string) error {
|
|
if w.WriteFunc == nil {
|
|
return nil
|
|
}
|
|
|
|
return w.WriteFunc(ctx, name, t, frames, extraLabels)
|
|
}
|