recorder implementations
All checks were successful
Build and Publish / release (push) Has been skipped
Build and Publish / check-chart (push) Successful in 11s
Build and Publish / helm-release (push) Has been skipped

This commit is contained in:
2025-03-22 12:05:25 -04:00
parent fb6941e6bd
commit b483fc22a3
16 changed files with 498 additions and 71 deletions

View File

@ -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{