-
-
Notifications
You must be signed in to change notification settings - Fork 163
/
Copy pathinfo.go
33 lines (28 loc) · 921 Bytes
/
info.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package controller
import (
"net/http"
"github.com/labstack/echo/v4"
"github.com/thomaspoignant/go-feature-flag/cmd/relayproxy/service"
)
type info struct {
monitoringService service.Monitoring
}
func NewInfo(monitoring service.Monitoring) Controller {
return &info{
monitoringService: monitoring,
}
}
// Handler is the entry point for the Info API
// @Summary Info
// @Tags Monitoring
// @Description Making a **GET** request to the URL path `/info` will give you information about the actual state
// @Description of the relay proxy.
// @Description
// @Description As of Today the level of information is small be we can improve this endpoint to returns more
// @Description information.
// @Produce json
// @Success 200 {object} model.InfoResponse
// @Router /info [get]
func (h *info) Handler(c echo.Context) error {
return c.JSON(http.StatusOK, h.monitoringService.Info())
}