Categorygithub.com/algoexpert-io/httpwrap
modulepackage
0.0.1
Repository: https://github.com/algoexpert-io/httpwrap.git
Documentation: pkg.go.dev

# README

httpwrap


httpwrap is a thin wrapper around the default http library that lets you compose handlers and automatically inject outputs into the inputs of the next handler.

# Packages

No description provided by the author

# Functions

EmptyConstructor is the default constructor for new wrappers.
New creates a new Wrapper object.
NewDecoder returns a new decoder with sensible defaults for the DecodeBody, Header and Query functions.
The StandardConstructor decodes the request using the following: - cookies - query params - path params - headers - JSON decoding of the body.

# Structs

Decoder is a struct that allows for the decoding of http requests into arbitrary objects.
Handler is a Wrapper that implements `http.Handler`.
Wrapper implements the http.Handler interface, wrapping the handlers that are passed in.

# Type aliases

Constructor is the function signature for unmarshalling an http request into an object.
DecodeFunc is the function signature for decoding a request into an object.