Versions in this module Expand all Collapse all v0 v0.2.0 Aug 16, 2024 Changes in this version + type ContextInitFunc func(r *http.Request) C v0.1.0 Jun 30, 2024 Changes in this version + var ErrBufferFull = errors.New("buffer is full") + func ChainStd(h http.Handler, m ...StdMiddleware) http.Handler + func ServeFunc[V any](hdlr HandlerFunc[V], os ...Option) http.Handler + func Serve[V any](hdlr Handler[V], os ...Option) http.Handler + type Context struct + V V + func NewContext[V any](c context.Context) *Context[V] + func (c *Context[V]) WithValue(req *http.Request, key, val any) (*Context[V], *http.Request) + func (c Context[V]) Deadline() (deadline time.Time, ok bool) + func (c Context[V]) Done() <-chan struct{} + func (c Context[V]) Err() error + func (c Context[V]) Value(key any) any + type Handler interface + ServeBHTTP func(ctx *Context[V], w ResponseWriter, r *http.Request) error + func Chain[V any](h Handler[V], m ...Middleware[V]) Handler[V] + type HandlerFunc func(*Context[V], ResponseWriter, *http.Request) error + func (f HandlerFunc[V]) ServeBHTTP(ctx *Context[V], w ResponseWriter, r *http.Request) error + type Logger interface + LogImplicitFlushError func(err error) + LogUnhandledServeError func(err error) + type Middleware func(Handler[V]) Handler[V] + type Option func(*opts) + func WithBufferLimit(v int) Option + func WithErrorLog(v Logger) Option + type ResponseBuffer struct + func NewBufferResponse(resp http.ResponseWriter, limit int) *ResponseBuffer + func (w *ResponseBuffer) FlushError() error + func (w *ResponseBuffer) Free() + func (w *ResponseBuffer) Header() http.Header + func (w *ResponseBuffer) ImplicitFlush() error + func (w *ResponseBuffer) Reset() + func (w *ResponseBuffer) Unwrap() http.ResponseWriter + func (w *ResponseBuffer) Write(buf []byte) (int, error) + func (w *ResponseBuffer) WriteHeader(statusCode int) + type ResponseWriter interface + Reset func() + type Reverser struct + func NewReverser() *Reverser + func (r Reverser) Named(name, s string) string + func (r Reverser) NamedPattern(name, s string) (string, error) + func (r Reverser) Reverse(name string, vals ...string) (string, error) + type ServeMux struct + func NewServeMux[V any](opts ...Option) *ServeMux[V] + func (m *ServeMux[V]) BHandle(pattern string, handler Handler[V], name ...string) + func (m *ServeMux[V]) BHandleFunc(pattern string, handler HandlerFunc[V], name ...string) + func (m *ServeMux[V]) BUse(mw ...Middleware[V]) + func (m *ServeMux[V]) Handle(pattern string, handler http.Handler, name ...string) + func (m *ServeMux[V]) HandleFunc(pattern string, handler http.HandlerFunc, name ...string) + func (m *ServeMux[V]) Reverse(name string, vals ...string) (string, error) + func (m *ServeMux[V]) Use(mw ...StdMiddleware) + func (m ServeMux[V]) ServeHTTP(w http.ResponseWriter, r *http.Request) + type StdMiddleware func(http.Handler) http.Handler