Skip to content
This repository has been archived by the owner on Apr 11, 2019. It is now read-only.

spkg/httpctx

Repository files navigation

Context-Aware HTTP Handlers

GoDoc Build Status (Linux) Build status (Windows) license GoReportCard

Deprecated

Go 1.7 includes the context package in the standard library, and the net/http package includes a Context in the http.Request structure. If you are targeting Go 1.7 and later, there is significantly less need for a package like httpctx.

Description

The httpctx package provides a convenient way to handle HTTP requests using "context-aware" handler functions. Context-aware handlers are different from the standard http.Handler in two important ways:

  1. They accept an additional parameter of the (almost) standard type context.Context (golang.org/x/net/context); and
  2. They return an error result.

The httpctx package also implements a simple middleware chaining mechanism. The idea for this comes from Justinas Stankevičius and his alice package. (https://github.com/justinas/alice).

For usage examples, refer to the GoDoc documentation.

About

Context-aware HTTP handlers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages