services

package
v0.0.0-...-6e23157 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ViaCepResponse

type ViaCepResponse struct {
	Erro        bool   `json:"erro"`
	Cep         string `json:"cep"`
	Logradouro  string `json:"logradouro"`
	Complemento string `json:"complemento"`
	Bairro      string `json:"bairro"`
	Localidade  string `json:"localidade"`
	UF          string `json:"uf"`
	IBGE        string `json:"ibge"`
	GIA         string `json:"gia"`
	DDD         string `json:"ddd"`
	SIAFI       string `json:"siafi"`
}

type ViaCepService

type ViaCepService interface {
	QueryCep(ctx context.Context, cep string) (*ViaCepResponse, error)
}

func NewViaCepService

func NewViaCepService() ViaCepService

type ViaCepServiceImpl

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

func (*ViaCepServiceImpl) QueryCep

func (s *ViaCepServiceImpl) QueryCep(ctx context.Context, cep string) (*ViaCepResponse, error)

type WeatherApiResponse

type WeatherApiResponse struct {
	Location WeatherApiResponseLocation `json:"location"`
	Current  WeatherApiResponseCurrent  `json:"current"`
}

type WeatherApiResponseCurrent

type WeatherApiResponseCurrent struct {
	TemperatureCelsius float64 `json:"temp_c"`
}

type WeatherApiResponseLocation

type WeatherApiResponseLocation struct {
	Name    string `json:"name"`
	Region  string `json:"region"`
	Country string `json:"country"`
}

type WeatherApiService

type WeatherApiService interface {
	QueryWeather(ctx context.Context, location string) (*WeatherApiResponse, error)
}

func NewWeatherApiService

func NewWeatherApiService() WeatherApiService

type WeatherApiServiceImpl

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

func (*WeatherApiServiceImpl) QueryWeather

func (s *WeatherApiServiceImpl) QueryWeather(ctx context.Context, location string) (*WeatherApiResponse, error)

Jump to

Keyboard shortcuts

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