Registry / web-framework / tylerb-graceful-v1

tylerb-graceful-v1

JSON →
library1.2.15gogounverified

Graceful shutdown of Go HTTP servers with support for timeouts and interrupts.

go get gopkg.in/tylerb/graceful.v1
INSTALL
IMPORT
SIG · TYLERB-GRACEFUL-V1
T
tylerb-graceful-v1
web-frameworkgov1.2.15
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

graceful
gopkg.in/tylerb/graceful.v1

Start an HTTP server with graceful shutdown on interrupt.

package main import ( "net/http" "time" "gopkg.in/tylerb/graceful.v1" ) func main() { mux := http.NewServeMux() mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { w.Write([]byte("Hello")) }) graceful.Run(":8080", 10*time.Second, mux) }
Debug
Known issues
breakingThe v1 API uses a different import path than later versions.
fix
Use gopkg.in/tylerb/graceful.v1 for v1.x, or migrate to github.com/tylerb/graceful for newer versions.
affects: >=1.0.0 <2.0.0
Upgrade
Version history
1.2.15latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
tylerb-graceful-v1 — go get tylerb-graceful-v1 · libregistry