goji.io: goji.io/middleware Index | Files

package middleware

import "goji.io/middleware"

Package middleware contains utilities for Goji Middleware authors.

Unless you are writing middleware for your application, you should avoid importing this package. Instead, use the abstractions provided by your middleware package.

Index

Package Files

middleware.go

func Handler Uses

func Handler(ctx context.Context) http.Handler

Handler returns the handler corresponding to the most recently matched Pattern, or nil if no pattern was matched.

The handler returned by this function is the one that will be dispatched to at the end of the middleware stack. If the returned Handler is nil, http.NotFound will be used instead.

func Pattern Uses

func Pattern(ctx context.Context) goji.Pattern

Pattern returns the most recently matched Pattern, or nil if no pattern was matched.

func SetHandler Uses

func SetHandler(ctx context.Context, h http.Handler) context.Context

SetHandler returns a new context in which the given Handler was most recently matched and which consequently will be dispatched to.

func SetPattern Uses

func SetPattern(ctx context.Context, p goji.Pattern) context.Context

SetPattern returns a new context in which the given Pattern is used as the most recently matched pattern.

Package middleware imports 4 packages (graph) and is imported by 5 packages. Updated 2017-01-28. Refresh now. Tools for package owners.