Documentation
¶
Index ¶
Constants ¶
View Source
const (
MB = 1 << 20 // 1 MB
)
Variables ¶
This section is empty.
Functions ¶
func ListenAndServe ¶
ListenAndServe starts the HTTP server with some sane defaults.
func ListenAndServeForever ¶
ListenAndServeForever allows zero-downtime upgrade. This is done by sending the signal SIGUSR2 to the binary. The binary will fork a child process and the parent process will exit. The child process will inherit the listener and continue serving requests. The parent process will gracefully shutdown after serving all the requests. E.g.
$ go build -o main $ kill -SIGUSR2 `lsof -ti:8080` $ curl localhost:8080
Types ¶
type ReadHeaderTimeout ¶
func (ReadHeaderTimeout) Apply ¶
func (r ReadHeaderTimeout) Apply(s *http.Server)
type ReadTimeout ¶
func (ReadTimeout) Apply ¶
func (r ReadTimeout) Apply(s *http.Server)
type WriteTimeout ¶
func (WriteTimeout) Apply ¶
func (r WriteTimeout) Apply(s *http.Server)
Click to show internal directories.
Click to hide internal directories.