service

package
v0.0.0-...-4d7482c Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 9 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        string `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"`
}

ViaCEPResponse é a estrutura que representa a resposta da API ViaCEP.

type ViaCepService

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

ViaCepService é a implementação do serviço ViaCep.

func NewViaCepService

func NewViaCepService() *ViaCepService

NewViaCepService cria uma nova instância de ViaCepService.

func (*ViaCepService) GetCEPData

func (s *ViaCepService) GetCEPData(ctx context.Context, cep string) (*ViaCEPResponse, error)

GetCEPData obtém os dados de um CEP usando a API ViaCEP.

type ViaCepServiceInterface

type ViaCepServiceInterface interface {
	GetCEPData(ctx context.Context, cep string) (*ViaCEPResponse, error)
}

ViaCepServiceInterface define a interface para o serviço ViaCep.

type WeatherAPIResponse

type WeatherAPIResponse struct {
	Current struct {
		TempC float64 `json:"temp_c"`
	} `json:"current"`
}

WeatherAPIResponse representa a estrutura da resposta da API de clima.

type WeatherApiService

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

WeatherApiService é a implementação do serviço de API de clima.

func NewWeatherApiService

func NewWeatherApiService() *WeatherApiService

NewWeatherApiService cria uma nova instância do serviço de API de clima.

func (*WeatherApiService) GetWeatherData

func (s *WeatherApiService) GetWeatherData(ctx context.Context, location string) (*WeatherAPIResponse, error)

GetWeatherData obtém os dados do clima para uma determinada localização.

type WeatherApiServiceInterface

type WeatherApiServiceInterface interface {
	GetWeatherData(ctx context.Context, location string) (*WeatherAPIResponse, error)
}

WeatherApiServiceInterface define a interface para o serviço de API de clima.

Jump to

Keyboard shortcuts

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