mirror of
https://github.com/MedzikUser/go-pingbot
synced 2024-08-14 23:57:07 +00:00
chore: update api status
This commit is contained in:
parent
7670dee9e9
commit
3af027afdc
3 changed files with 6 additions and 7 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -14,4 +14,5 @@ dist/
|
|||
*.test
|
||||
|
||||
# Configs
|
||||
config.toml
|
||||
*.toml*
|
||||
!*schema.toml
|
||||
|
|
|
@ -6,9 +6,7 @@ import (
|
|||
|
||||
func ApplyRoutes(r *gin.Engine) {
|
||||
api := r.Group("/api")
|
||||
{
|
||||
api.GET("/url", GetAll)
|
||||
|
||||
api.GET("/status", Status)
|
||||
}
|
||||
api.GET("/url", GetAll)
|
||||
api.GET("/status", Status)
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ func Status(c *gin.Context) {
|
|||
p = json{
|
||||
"all": ping.Status.Error + ping.Status.Success,
|
||||
"success": ping.Status.Success,
|
||||
"err": ping.Status.Error,
|
||||
"error": ping.Status.Error,
|
||||
}
|
||||
} else {
|
||||
p = nil
|
||||
|
@ -37,7 +37,7 @@ func Status(c *gin.Context) {
|
|||
"uptime": common.Uptime(config.StartTime),
|
||||
"pid": cpu.PID,
|
||||
"os": runtime.GOOS,
|
||||
"mem": json{
|
||||
"memory": json{
|
||||
"alloc": mem.Alloc,
|
||||
"totalalloc": mem.TotalAlloc,
|
||||
"sys": mem.Sys,
|
||||
|
|
Loading…
Reference in a new issue