server: shutdown endpoint (#466)

fixes #390
This commit is contained in:
C Cirello
2016-12-29 20:19:42 +01:00
committed by GitHub
parent c2c2a0fb06
commit e3c85d3e7e
5 changed files with 42 additions and 3 deletions

View File

@@ -0,0 +1,11 @@
package server
import "context"
type ServerOption func(*Server)
func EnableShutdownEndpoint(halt context.CancelFunc) ServerOption {
return func(s *Server) {
s.Router.GET("/shutdown", s.handleShutdown(halt))
}
}