Skip to content

go-http-utils/timeout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

timeout

Build Status Coverage Status

HTTP timeout middleware for Go.

Installation

go get -u github.com/go-http-utils/timeout

Documentation

API documentation can be found here: https://godoc.org/github.com/go-http-utils/timeout

Usage

import (
  "github.com/go-http-utils/timeout"
)
mux := http.NewServeMux()
mux.HandleFunc("/", func(res http.ResponseWriter, req *http.Request) {
  res.Write([]byte("Hello World"))
})

http.ListenAndServe(":8080", timeout.Handler(mux, time.Second*10, timeout.DefaultTimeoutHandler))

Releases

No releases published

Packages

No packages published