web

package
v0.0.0-...-5159988 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthHandler

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

func (*HealthHandler) GetHealth

func (h *HealthHandler) GetHealth(w http.ResponseWriter, r *http.Request)

GetHealth é o handler responsável por retornar informações sobre a saúde do serviço @Summary Retorna informações sobre a saúde do serviço @Description Retorna informações sobre a saúde do serviço, como uso de CPU, memória e tempo de atividade @Tags Health @Produce json @Success 200 {object} health.HealthStats @Failure 500 {string} string "Internal Server Error" @Router /health [get]

type WeatherHandler

type WeatherHandler struct {
	Usecase contract.WeatherByCepUsecase
}

func (*WeatherHandler) GetWeatherByCep

func (h *WeatherHandler) GetWeatherByCep(w http.ResponseWriter, r *http.Request)

GetWeatherByCep é o handler que consulta o (CEP), encontra a localidade e retorna o clima atual. @Summary Consulta o clima atual de uma localidade a partir do CEP @Description Consulta o clima atual de uma localidade a partir do CEP. Retorna a cidade e a temperatura atual em Celsius, Fahrenheit e Kelvin. @Tags Weather @Produce json @param cep path string true "CEP para buscar a temperatura" @Success 200 {object} WeatherResponseSummary @Failure 422 {string} string "invalid zipcode" @Failure 404 {string} string "can not find zipcode" @Failure 500 {string} string "internal server error" @Router /weather/{cep} [get]

type WeatherResponseSummary

type WeatherResponseSummary struct {
	City  string  `json:"city"`
	TempC float64 `json:"temp_C"`
	TempF float64 `json:"temp_F"`
	TempK float64 `json:"temp_K"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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