Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

3 Commits

Repository files navigation

Sigterm

$ go get github.com/l-hellmann/sigterm

Usage

package main
import (
"context""fmt""net/http""github.com/l-hellmann/sigterm"
)
funcmain() {
ctx:=sigterm.Context()
s:=&http.Server{
Addr: ":80",
Handler: http.HandlerFunc(func(w http.ResponseWriter, r*http.Request) {
fmt.Fprintln(w, "hello world")
}),
}
gofunc() {
iferr:=s.ListenAndServe(); err!=nil {
panic(err)
}
}()
<-ctx.Done()
_=s.Shutdown(context.Background())
}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages