func Show(c *gin.Context) { identifier := c.Param("identifier") var service interface{} if identifier != "" { service, _ = services.GetService(identifier) } else { c.String(404, "Service not found.") } c.JSON(200, service) }
func RescheduleCheck(c *gin.Context) { identifier := c.Param("identifier") var result string if identifier != "" { service, _ := services.GetService(identifier) service.Reschedule() result = "Command sent" } else { result = "No identifier specified." } c.JSON(200, gin.H{ "result": result, }) }
func Update(c *gin.Context) { identifier := c.Param("identifier") var result string if identifier != "" { service, _ := services.GetService(identifier) err := services.UpdateService(service) if err != nil { result = "Could not update service." log.Error(result, identifier) } } else { result = "No parameter to update!" } c.JSON(200, gin.H{ "result": result, }) }