starter.go 221 B

12345678910111213141516
  1. package internal
  2. import (
  3. "context"
  4. "net/http"
  5. "zero/core/proc"
  6. )
  7. func StartServer(srv *http.Server) error {
  8. proc.AddWrapUpListener(func() {
  9. srv.Shutdown(context.Background())
  10. })
  11. return srv.ListenAndServe()
  12. }