admin

package
v0.0.0-...-537b99d Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

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]

Jump to

Keyboard shortcuts

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