Files
Maven/internal/weather/weather.go
T
kami e030466cac maven: weather module skeleton with open-meteo provider (task 5)
- New internal/weather/ package: Provider interface, Weather struct, StubProvider
- OpenMeteoProvider with geocoding + current weather (keyless, free API)
- Config: WeatherConfig in VoiceConfig (provider, default_location)
- Wire in voice.go as weatherProvider on reactiveHandler
- Handle weather queries in IntentQuery (before notes RAG)
- Helper: isWeatherQuery / extractWeatherLocation
- Tests: mocked HTTP round-trip for OpenMeteo, stub ErrNotConfigured, config tests
- No real network calls in any test

Co-Authored-By: opencode <opencode@anthropic.com>
2026-07-06 04:15:54 +04:00

27 lines
582 B
Go

package weather
import (
"context"
"errors"
)
var ErrNotConfigured = errors.New("weather: not configured")
type Weather struct {
Location string `json:"location"`
Temperature float64 `json:"temperature"`
Condition string `json:"condition"`
}
type Provider interface {
CurrentWeather(ctx context.Context, location string) (Weather, error)
}
type StubProvider struct{}
func NewStubProvider() *StubProvider { return &StubProvider{} }
func (s *StubProvider) CurrentWeather(_ context.Context, location string) (Weather, error) {
return Weather{}, ErrNotConfigured
}