recorder implementations
This commit is contained in:
@ -10,7 +10,6 @@ import (
|
||||
"gitea.libretechconsulting.com/rmcguire/go-app/pkg/otel"
|
||||
|
||||
"gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/pkg/weather/recorder/recorders"
|
||||
"gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/pkg/weather/recorder/recorders/memory"
|
||||
)
|
||||
|
||||
type WeatherRecorder struct {
|
||||
@ -27,13 +26,13 @@ type Opts struct {
|
||||
KeepLast int
|
||||
}
|
||||
|
||||
func NewWeatherRecorder(opts *Opts) *WeatherRecorder {
|
||||
func MustNewWeatherRecorder(opts *Opts) *WeatherRecorder {
|
||||
if opts.KeepLast < 1 {
|
||||
opts.KeepLast = 1
|
||||
}
|
||||
|
||||
if opts.Recorder == nil {
|
||||
opts.Recorder = &memory.MemoryRecorder{}
|
||||
panic("no recorder provided")
|
||||
}
|
||||
|
||||
opts.Recorder.Init(opts.Ctx, &recorders.RecorderOpts{
|
||||
|
Reference in New Issue
Block a user