internal

package
v0.0.0-...-a55320a Latest Latest
Warning

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

Go to latest
Published: May 9, 2016 License: MIT, MIT Imports: 2 Imported by: 0

Documentation

Overview

Package internal is a private package that allows Goji to expose a less confusing interface to its users. This package must not be used outside of Goji; every piece of its functionality has been exposed by one of Goji's subpackages.

The problem this package solves is to allow Goji to internally agree on types and secret values between its packages without introducing import cycles. Goji needs to agree on these types and values in order to organize its public API into audience-specific subpackages (for instance, a package for pattern authors, a package for middleware authors, and a main package for routing users) without exposing implementation details in any of the packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextKey

type ContextKey int

ContextKey is a type used for Goji's context.Context keys.

const (
	// Path is the context key used to store the path Goji uses for its
	// PathPrefix optimization.
	Path ContextKey = iota
	// Pattern is the context key used to store the Pattern that Goji last
	// matched.
	Pattern
	// Handler is the context key used to store the Handler that Goji last
	// mached (and will therefore dispatch to at the end of the middleware
	// stack).
	Handler
)

type ContextWrapper

type ContextWrapper struct {
	http.Handler
}

ContextWrapper is a standard bridge type from http.Handlers to context-aware Handlers. It is included here so that the middleware subpackage can use it to unwrap Handlers.

func (ContextWrapper) ServeHTTPC

func (c ContextWrapper) ServeHTTPC(ctx context.Context, w http.ResponseWriter, r *http.Request)

ServeHTTPC implements goji.Handler.

Jump to

Keyboard shortcuts

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