feat: planned structure

This commit is contained in:
Anatoly Antonov 2025-06-21 23:11:38 +03:00
parent bcb9ace54c
commit 5240968c33
4 changed files with 41 additions and 4 deletions

View file

@ -11,6 +11,6 @@ type Redis interface {
Get(key string) ([]byte, error)
}
type Downloader interface {
Download(ctx context.Context)
type Grib interface {
Update(ctx context.Context) error
}

View file

@ -1,10 +1,22 @@
package service
import (
"context"
)
type Service struct {
redis Redis
downloader Downloader
}
func New() *Service {
return &Service{}
func New(redis Redis, downloader Downloader) *Service {
return &Service{
redis: redis,
downloader: downloader,
}
}
// DownloadWeatherData downloads weather forecast data using the configured downloader
func (s *Service) DownloadWeatherData(ctx context.Context) error {
return s.downloader.Download(ctx)
}