services

package
v0.0.0-...-c197fc7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GeoNameService

type GeoNameService struct {
	// contains filtered or unexported fields
}

func NewGeoNameService

func NewGeoNameService(sender Sender, logger models.Logger, fuzzy float64) GeoNameService

func (*GeoNameService) GetCoordinates

func (s *GeoNameService) GetCoordinates(json map[string]interface{}) (models.Coordinates, error)

func (*GeoNameService) ValidateCity

func (s *GeoNameService) ValidateCity(city string, country string) (string, models.Coordinates, error)

func (*GeoNameService) ValidateCountry

func (s *GeoNameService) ValidateCountry(country string) (string, error)

func (*GeoNameService) ValidateTotalResultsCount

func (s *GeoNameService) ValidateTotalResultsCount(json map[string]interface{}) error

type GeoService

type GeoService interface {
	ValidateCountry(country string) (string, error)
	ValidateCity(city string, country string) (string, models.Coordinates, error)
}

type HHTPSender

type HHTPSender struct {
	Log models.Logger
}

func (*HHTPSender) SendGetRequest

func (s *HHTPSender) SendGetRequest(URL string) ([]byte, error)

type Sender

type Sender interface {
	SendGetRequest(URL string) ([]byte, error)
}

type WeatherPredictorService

type WeatherPredictorService struct {
	URL string
	// contains filtered or unexported fields
}

func NewWeatherPredictorService

func NewWeatherPredictorService(URL string, sender Sender, log models.Logger) WeatherPredictorService

func (*WeatherPredictorService) GetDateFormatted

func (w *WeatherPredictorService) GetDateFormatted(time time.Time) string

func (*WeatherPredictorService) GetParamsFromWeatherData

func (w *WeatherPredictorService) GetParamsFromWeatherData(weatherData models.WeatherData) []*utils.HTTPParam

func (*WeatherPredictorService) GetTemperatureAndChart

func (w *WeatherPredictorService) GetTemperatureAndChart(weatherData models.WeatherData) (float64, string, error)

func (*WeatherPredictorService) GetWeatherPredictionMessage

func (w *WeatherPredictorService) GetWeatherPredictionMessage(weatherData models.WeatherData, chatID int64) (tgbotapi.Chattable, error)

type WeatherService

type WeatherService interface {
	GetWeatherPredictionMessage(weatherData models.WeatherData, chatID int64) (tgbotapi.Chattable, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL