Documentation ¶
Index ¶
- type Health
- type Heartbeat
- type HeartbeatResponse
- type Info
- type ResourceContext
- func (ctx *ResourceContext) GetHealth(w http.ResponseWriter, r *http.Request)
- func (ctx *ResourceContext) GetHeartbeat(w http.ResponseWriter, r *http.Request)
- func (ctx *ResourceContext) GetInfo(w http.ResponseWriter, r *http.Request)
- func (ctx *ResourceContext) NewAdminRouter() http.Handler
- func (ctx *ResourceContext) SafeClose()
- func (ctx *ResourceContext) StartHeartbeat(w http.ResponseWriter, r *http.Request)
- func (ctx *ResourceContext) StopHeartbeat(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Health ¶
type Health struct { CPU interface{} Memory interface{} Host interface{} Disk interface{} DBConnectionHealth string CacheHealth string KinesisHealth string }
Health for health of the service
type Heartbeat ¶
type Heartbeat struct {
Status string `json: "status"`
}
Heartbeat for heart beat status of the service
type HeartbeatResponse ¶
type HeartbeatResponse struct { Data Heartbeat `json: "heartbeat"` Error commons.APIError `json: "error"` }
HeartbeatResponse for heart beat response of the service
type Info ¶
type Info struct { CPU interface{} Memory interface{} Host interface{} Disk interface{} DBConnectionHealth string CacheHealth string KinesisHealth string }
Info for health info
type ResourceContext ¶
type ResourceContext struct {
HeartbeatStatus string
}
ResourceContext holds service instance
func NewAdminResource ¶
func NewAdminResource() *ResourceContext
NewAdminResource creates new resource context
func (*ResourceContext) GetHealth ¶
func (ctx *ResourceContext) GetHealth(w http.ResponseWriter, r *http.Request)
@Summary Get Health @Tags Admin @Success 200 {object} HeartbeatResponse @Failure 400 {object} Response @Router /admin/_health [get]
func (*ResourceContext) GetHeartbeat ¶
func (ctx *ResourceContext) GetHeartbeat(w http.ResponseWriter, r *http.Request)
@Summary Get Heartbeat @Tags Admin @Success 200 {object} HeartbeatResponse @Failure 400 {object} Response @Router /admin/heartbeat [get]
func (*ResourceContext) GetInfo ¶
func (ctx *ResourceContext) GetInfo(w http.ResponseWriter, r *http.Request)
@Summary Get Info @Tags Admin @Success 200 {object} HeartbeatResponse @Failure 400 {object} Response @Router /admin/_info [get]
func (*ResourceContext) NewAdminRouter ¶
func (ctx *ResourceContext) NewAdminRouter() http.Handler
NewAdminRouter creates new admin router
func (*ResourceContext) SafeClose ¶
func (ctx *ResourceContext) SafeClose()
SafeClose gets called when program terminates
func (*ResourceContext) StartHeartbeat ¶
func (ctx *ResourceContext) StartHeartbeat(w http.ResponseWriter, r *http.Request)
@Summary Enable Heartbeat @Tags Admin @Success 200 {object} HeartbeatResponse @Failure 400 {object} Response @Router /admin/heartbeat/_start [get]
func (*ResourceContext) StopHeartbeat ¶
func (ctx *ResourceContext) StopHeartbeat(w http.ResponseWriter, r *http.Request)
@Summary Disable Heartbeat @Tags Admin @Success 200 {object} HeartbeatResponse @Failure 400 {object} Response @Router /admin/heartbeat/_stop [get]