Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMissingContext is used as a panic object for when Get is // used with an context, which does not contain the requested // holder key. ErrMissingContext = errors.New("pooler middleware missing in request context") )
Functions ¶
func NewMiddleware ¶
func NewMiddleware(key interface{}, factoryMethod func() interface{}) func(h http.Handler) http.Handler
NewMiddleware initializes a new middleware for providing object pooling capabilities. This middleware injects an object pool into the request context via the given key. This pool can be accessed with this packages Get method, and the same key. Returning objects is not required, as they are returned after the request ended.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.