Documentation ¶
Index ¶
Constants ¶
View Source
const ( StatusOK string = "OK" StatusPartiallyAvailable string = "Partially Available" StatusTimeout string = "Timeout during health check" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Check ¶ added in v1.0.1
type Check struct { // Status is the check status. Status string `json:"status"` // Timestamp is the time in which the check occurred. Timestamp string `json:"timestamp"` // StartUp is the time to boot up the system. StartUp string `json:"startup"` // Uptime is the time in which the check occurred. Uptime string `json:"uptime"` // Failures holds the failed checks along with their messages. Failures map[string]string `json:"failures,omitempty"` // System holds information of the go process. System `json:"system"` }
Check represents the health check response.
type HealthCheck ¶ added in v1.0.1
type HealthCheck interface {
HealthCheck(ctx *gin.Context, startTime time.Time, bootTime time.Duration)
}
func NewHealthCheck ¶ added in v1.0.1
func NewHealthCheck() HealthCheck
type Message ¶
type Message interface { Add(ctx *gin.Context) Get(ctx *gin.Context) GetAndRead(ctx *gin.Context) GetAll(ctx *gin.Context) Update(ctx *gin.Context) Delete(ctx *gin.Context) }
func NewMessage ¶
func NewMessage(messageRepo repository.MessageRepo) Message
NewMessage returns a new message controller
type System ¶ added in v1.0.1
type System struct { // Version is the go version. Version string `json:"version"` // GoroutinesCount is the number of the current goroutines. GoroutinesCount int `json:"goroutines_count"` // TotalAllocBytes is the total bytes allocated. TotalAllocBytes int `json:"total_alloc_bytes"` // HeapObjectsCount is the number of objects in the go heap. HeapObjectsCount int `json:"heap_objects_count"` // TotalAllocBytes is the bytes allocated and not yet freed. AllocBytes int `json:"alloc_bytes"` }
System runtime variables about the go process.
func NewSystemMetrics ¶ added in v1.0.1
func NewSystemMetrics() System
NewSystemMetrics returns a new SystemMetrics struct
Click to show internal directories.
Click to hide internal directories.