test

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiHandler added in v1.1.0

type ApiHandler struct {
	HttpClient *http.Client
}

func NewApiHandler added in v1.1.0

func NewApiHandler(httpClient *http.Client) *ApiHandler

func (*ApiHandler) Weather added in v1.1.0

func (h *ApiHandler) Weather(ctx echo.Context) error

Weather fetches the latest weather forecast for Amsterdam.

@Summary Weather forecast @Description Performs an external api call to get weather forecast @Tags weather @ID weather-forecast @Produce json @Success 200 {object} WeatherForecast "OK" @Failure 503 {object} WeatherForecast "Service Unavailable" @Router /weather/amsterdam [get]

type ForecastLocation added in v1.1.0

type ForecastLocation string // @name forecastLocation

ForecastLocation defines the location of the weather forecast.

type ForecastSummary added in v1.1.0

type ForecastSummary string // @name forecastSummary

ForecastSummary the specifics of the weather forecast.

type Handler

type Handler struct{}

Handler defines the http router implementation for health endpoints.

func NewHandler

func NewHandler() *Handler

NewHandler creates a new Handler for health endpoints.

func (*Handler) Live

func (h *Handler) Live(ctx echo.Context) error

Live performs a live check.

@Summary Live healthcheck @Description Performs a live check @Tags health @ID health-live @Produce json @Success 200 {object} ServiceHealth "OK" @Failure 503 {object} ServiceHealth "Service Unavailable" @Router /health/live [get]

func (*Handler) Ready

func (h *Handler) Ready(ctx echo.Context) error

Ready performs readiness check.

@Summary Ready healthcheck @Description Performs readiness check @Tags health @ID health-ready @Success 200 "OK" @Failure 503 {object} ServiceHealth "Service Unavailable" @Router /health/ready [get]

type ServiceHealth

type ServiceHealth struct {
	ServiceStatus ServiceHealthStatus      `json:"status"`
	Description   ServiceHealthDescription `json:"description"`
	CompletedAt   time.Time                `json:"completed_at"`
}

ServiceHealth defines the health of the service.

type ServiceHealthDescription

type ServiceHealthDescription string // @name serviceHealthDescription

ServiceHealthDescription describes the state of the service status.

type ServiceHealthStatus

type ServiceHealthStatus string // @name serviceHealthStatus

ServiceHealthStatus defines the status of the service.

type WeatherForecast added in v1.1.0

type WeatherForecast struct {
	Location ForecastLocation `json:"location"`
	Summary  ForecastSummary  `json:"summary"`

} // @name WeatherForecast

WeatherForecast provides information about the weather

Jump to

Keyboard shortcuts

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