http

package
v1.3.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Route

func Route(handlers ...RouteHandler) http.Handler

Route returns a http.Handler that routes requests to the appropriate given handler.

func Version

func Version(h http.Handler, etag string) http.Handler

Version returns a decorated version of the given handler that inject ETag and cache headers in order let browsers detect if they need to continue their request for a resource.

func Watch

func Watch(h http.Handler) http.Handler

Watch returns a decorated version of the given handler that provide insight on the request.

Types

type RouteHandler

type RouteHandler interface {
	http.Handler

	// Handle reports whether the handler can handle the given request.
	CanHandle(r *http.Request) bool
}

RouteHandler is the interface that describe a routable http.Handler.

func Files

func Files(dir string) RouteHandler

Files returns a handler that serves files from the given directory.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL