Documentation
¶
Index ¶
- Constants
- type Handler
- func (h *Handler) ConfigureMiddleware(e *echo.Echo)
- func (h *Handler) CreateNotification(c echo.Context) error
- func (h *Handler) CreateService(c echo.Context) error
- func (h *Handler) CreateToken(c echo.Context) (err error)
- func (h *Handler) DeleteNotification(c echo.Context) error
- func (h *Handler) DeleteService(c echo.Context) error
- func (h *Handler) DeleteToken(c echo.Context) (err error)
- func (h *Handler) GetHeartbeatStats(c echo.Context) error
- func (h *Handler) GetHeartbeatsLastLatencies(c echo.Context) error
- func (h *Handler) GetHeartbeatsLatencies(c echo.Context) error
- func (h *Handler) GetNotification(c echo.Context) error
- func (h *Handler) GetNotifications(c echo.Context) error
- func (h *Handler) GetService(c echo.Context) error
- func (h *Handler) GetServices(c echo.Context) error
- func (h *Handler) RegisterRoutes(e *echo.Echo)
- func (h *Handler) ServiceAddNotification(c echo.Context) error
- func (h *Handler) ServiceDeleteNotification(c echo.Context) error
- func (h *Handler) UpdateNotification(c echo.Context) error
- func (h *Handler) UpdateService(c echo.Context) error
- type StackdriverFormatter
- type StackdriverPayload
- type StackdriverTimestamp
Constants ¶
const (
// Key (Should come from somewhere else).
Key = "secret"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
func NewHandler ¶
func (*Handler) ConfigureMiddleware ¶
func (h *Handler) ConfigureMiddleware(e *echo.Echo)
func (*Handler) CreateNotification ¶
CreateNotification godoc @Summary Create a new notification @Description Creates notifications @Tags notifications @Accept json @Produce json @Param body body model.AddNotification true "Add notification" @Success 200 {object} model.Notification @Failure 404 {object} echo.HTTPError @Failure 500 {object} echo.HTTPError @Security HttpBearer @Router /API/v1/notifications [post]
func (*Handler) CreateService ¶
CreateService godoc @Summary Create a new service @Description Creates a new service and starts monitor it @Tags services @Accept json @Produce json @Param body body model.AddService true "Add service" @Success 200 {object} model.Service @Failure 404 {object} echo.HTTPError @Failure 500 {object} echo.HTTPError @Security HttpBearer @Router /API/v1/services [post]
func (*Handler) CreateToken ¶
CreateService godoc @Summary Create an auth token @Description Create an auth token @Tags tokens @Accept json @Produce json @Param body body model.CreateToken true "Create an auth token" @Success 200 {object} model.Token @Failure 404 {object} echo.HTTPError @Failure 500 {object} echo.HTTPError @Router /API/v1/tokens [post]
func (*Handler) DeleteNotification ¶
DeleteNotification godoc @Summary Delete a notification @Description Deletes notifications @Tags notifications @Accept json @Produce json @Param notification_name path string true "Delete by notification_name" @Success 200 {object} model.Notification @Failure 404 {object} echo.HTTPError @Failure 500 {object} echo.HTTPError @Security HttpBearer @Router /API/v1/notifications/{notification_name} [delete]
func (*Handler) DeleteService ¶
DeleteService godoc @Summary Delete a service @Description Stops a service monitoring and deletes it @Tags services @Accept json @Produce json @Param service_id path string true "Delete by service_id" @Success 204 {object} model.Service @Failure 404 {object} echo.HTTPError @Failure 500 {object} echo.HTTPError @Security HttpBearer @Router /API/v1/services/{service_id} [delete]
func (*Handler) DeleteToken ¶
DeleteToken godoc @Summary Delete an auth token @Description Delete an auth token @Tags tokens @Accept json @Produce json @Success 204 {object} model.Token @Failure 404 {object} echo.HTTPError @Failure 500 {object} echo.HTTPError @Security HttpBearer @Router /API/v1/tokens [delete]
func (*Handler) GetHeartbeatStats ¶
GetHeartbeatStats godoc @Summary GetHeartbeatStats stats @Description Returns heartbeats stats @Tags heartbeats @Accept json @Produce json @Param days path int true "Number of days to get stats for" @Success 200 {object} []model.HeartbeatStatsPoint @Failure 404 {object} echo.HTTPError @Failure 500 {object} echo.HTTPError @Security HttpBearer @Router /API/v1/heartbeats/stats/{days} [get]
func (*Handler) GetHeartbeatsLastLatencies ¶
GetHeartbeatsLastLatencies godoc @Summary GetHeartbeatsLastLatencies stats @Description Returns last latencies @Tags heartbeats @Accept json @Produce json @Param size query string false "Size" @Success 200 {object} []model.HeartbeatPoint @Failure 404 {object} echo.HTTPError @Failure 500 {object} echo.HTTPError @Security HttpBearer @Router /API/v1/heartbeats/latencies/last [get]
func (*Handler) GetHeartbeatsLatencies ¶
GetHeartbeats godoc @Summary Get all heartbeats @Description Returns all heartbeats @Tags heartbeats @Accept json @Produce json @Param service_id query string false "Filtering by service_id" @Param size query string false "Size" @Success 200 {object} []model.Heartbeat @Failure 404 {object} echo.HTTPError @Failure 500 {object} echo.HTTPError @Security HttpBearer @Router /API/v1/heartbeats/latencies [get]
func (*Handler) GetNotification ¶
GetNotification godoc @Summary Get a notification @Description Returns a notification @Tags notifications @Accept json @Produce json @Param notification_name path string true "Get a notification by notification_name" @Success 200 {object} model.Notification @Failure 404 {object} echo.HTTPError @Failure 500 {object} echo.HTTPError @Security HttpBearer @Router /API/v1/notifications/{notification_name} [get]
func (*Handler) GetNotifications ¶
GetNotifications godoc @Summary Get notifications @Description Returns all notifications @Tags notifications @Accept json @Produce json @Success 200 {object} []model.Notification @Failure 404 {object} echo.HTTPError @Failure 500 {object} echo.HTTPError @Security HttpBearer @Router /API/v1/notifications [get]
func (*Handler) GetService ¶
GetService godoc @Summary Get a service @Description Gets a service by its ID @Tags services @Accept json @Produce json @Param service_id path string true "Gets service by service_id" @Success 200 {object} model.Service @Failure 404 {object} echo.HTTPError @Failure 500 {object} echo.HTTPError @Security HttpBearer @Router /API/v1/services/{service_id} [get]
func (*Handler) GetServices ¶
GetServices godoc @Summary Get all services @Description Returns all services @Tags services @Accept json @Produce json @Success 200 {object} []model.Service @Failure 404 {object} echo.HTTPError @Failure 500 {object} echo.HTTPError @Security HttpBearer @Router /API/v1/services [get]
func (*Handler) RegisterRoutes ¶
func (h *Handler) RegisterRoutes(e *echo.Echo)
func (*Handler) ServiceAddNotification ¶
ServiceAddNotification godoc @Summary Add a notification to a service @Description Adds a notification to a service @Tags services @Accept json @Produce json @Param service_id path string true "service_id" @Param notification_name path string true "notification_name" @Success 200 {object} model.ServiceNotification @Failure 404 {object} echo.HTTPError @Failure 500 {object} echo.HTTPError @Security HttpBearer @Router /API/v1/services/{service_id}/notifications/{notification_name} [post]
func (*Handler) ServiceDeleteNotification ¶
ServiceDeleteNotification godoc @Summary Delete a notification to a service @Description Deletes a notification to a service @Tags services @Accept json @Produce json @Param service_id path string true "service_id" @Param notification_name path string true "notification_name" @Success 204 {object} model.ServiceNotification @Failure 404 {object} echo.HTTPError @Failure 500 {object} echo.HTTPError @Security HttpBearer @Router /API/v1/services/{service_id}/notifications/{notification_name} [delete]
func (*Handler) UpdateNotification ¶
UpdateNotification godoc @Summary Update a notification @Description Updates a notification @Tags notifications @Accept json @Produce json @Param notification_name path string true "Updates a notification by notification_name" @Param body body model.UpdateNotification true "Update notification" @Success 200 {object} model.Notification @Failure 404 {object} echo.HTTPError @Failure 500 {object} echo.HTTPError @Security HttpBearer @Router /API/v1/notifications/{notification_name} [patch]
func (*Handler) UpdateService ¶
UpdateService godoc @Summary Update a service @Description Updates an existing service and restarts monitoring for it @Tags services @Accept json @Produce json @Param service_id path string true "Updates by service_id" @Param body body model.UpdateService true "Update service" @Success 200 {object} model.Service @Failure 404 {object} echo.HTTPError @Failure 500 {object} echo.HTTPError @Security HttpBearer @Router /API/v1/services/{service_id} [patch]
type StackdriverFormatter ¶
type StackdriverFormatter struct { }