File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package handler
33import (
44 "github.com/gin-gonic/gin"
55 "github.com/thecasualcoder/dobby/pkg/config"
6+ "log"
67 "os"
78 "strconv"
89)
@@ -24,6 +25,11 @@ func Version(c *gin.Context) {
2425 c .JSON (200 , gin.H {"version" : version })
2526}
2627
28+ // Crash will make dobby to kill itself
29+ func Crash (_ * gin.Context ) {
30+ log .Fatal ("you asked me do so, killing myself :-)" )
31+ }
32+
2733func init () {
2834 healthy , err := strconv .ParseBool (os .Getenv ("HEALTH" ))
2935
Original file line number Diff line number Diff line change @@ -12,5 +12,6 @@ func Run(bindAddress, port string) error {
1212
1313 r .GET ("/health" , handler .Health )
1414 r .GET ("/version" , handler .Version )
15+ r .PUT ("/state/crash" , handler .Crash )
1516 return r .Run (fmt .Sprintf ("%s:%s" , bindAddress , port ))
1617}
You can’t perform that action at this time.
0 commit comments