Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Logger = func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { start := time.Now() next.ServeHTTP(w, r) log.Printf("Served %s for %q in %v", r.URL, r.UserAgent(), time.Since(start)) }) }
Logger is the logging middleware for gracefulserver. By default it logs the URL, UserAgent, and duration of requests with Go standard logger.
View Source
var ( // Timeout is the amount of time the server will wait for requests to finish during shutdown Timeout = 5 * time.Second )
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.