Documentation
¶
Index ¶
- Variables
- func BasicAuth(r *http.Request) (struct{ ... }, error)
- func BearerToken(r *http.Request) (string, error)
- func BoolQueryParam(name string) func(r *http.Request) (bool, error)
- func Combine2[T1, T2 any](decoder1 func(r *http.Request) (T1, error), ...) func(r *http.Request) (struct{ ... }, error)
- func FloatQueryParam(name string) func(r *http.Request) (float64, error)
- func FormFile(name string) func(r *http.Request) (*MultipartFile, error)
- func FormValue(name string) func(r *http.Request) (string, error)
- func Handle(handler RequestHandler) http.HandlerFunc
- func HandlePipeline1[C any](p Pipeline1[C], handler func(ctx context.Context, val C) Responder) http.HandlerFunc
- func HandlePipeline2[C1, C2 any](p Pipeline2[C1, C2], ...) http.HandlerFunc
- func HandlePipeline3[C1, C2, C3 any](p Pipeline3[C1, C2, C3], ...) http.HandlerFunc
- func HandlePipeline4[C1, C2, C3, C4 any](p Pipeline4[C1, C2, C3, C4], ...) http.HandlerFunc
- func HandlePipeline5[C1, C2, C3, C4, C5 any](p Pipeline5[C1, C2, C3, C4, C5], ...) http.HandlerFunc
- func HandlePipeline6[C1, C2, C3, C4, C5, C6 any](p Pipeline6[C1, C2, C3, C4, C5, C6], ...) http.HandlerFunc
- func HandlePipeline7[C1, C2, C3, C4, C5, C6, C7 any](p Pipeline7[C1, C2, C3, C4, C5, C6, C7], ...) http.HandlerFunc
- func HandlePipeline8[C1, C2, C3, C4, C5, C6, C7, C8 any](p Pipeline8[C1, C2, C3, C4, C5, C6, C7, C8], ...) http.HandlerFunc
- func HandlePipelineWithInput1[C, T any](p Pipeline1[C], inputDecoder func(r *http.Request) (T, error), ...) http.HandlerFunc
- func HandlePipelineWithInput2[C1, C2, T any](p Pipeline2[C1, C2], inputDecoder func(r *http.Request) (T, error), ...) http.HandlerFunc
- func HandlePipelineWithInput3[C1, C2, C3, T any](p Pipeline3[C1, C2, C3], inputDecoder func(r *http.Request) (T, error), ...) http.HandlerFunc
- func HandlePipelineWithInput4[C1, C2, C3, C4, T any](p Pipeline4[C1, C2, C3, C4], inputDecoder func(r *http.Request) (T, error), ...) http.HandlerFunc
- func HandlePipelineWithInput5[C1, C2, C3, C4, C5, T any](p Pipeline5[C1, C2, C3, C4, C5], inputDecoder func(r *http.Request) (T, error), ...) http.HandlerFunc
- func HandlePipelineWithInput6[C1, C2, C3, C4, C5, C6, T any](p Pipeline6[C1, C2, C3, C4, C5, C6], ...) http.HandlerFunc
- func HandlePipelineWithInput7[C1, C2, C3, C4, C5, C6, C7, T any](p Pipeline7[C1, C2, C3, C4, C5, C6, C7], ...) http.HandlerFunc
- func HandlePipelineWithInput8[C1, C2, C3, C4, C5, C6, C7, C8, T any](p Pipeline8[C1, C2, C3, C4, C5, C6, C7, C8], ...) http.HandlerFunc
- func HandleWithInput[T any](handler RequestHandlerWithInput[T], opts ...func(*handleWithInput[T])) http.HandlerFunc
- func HeaderValue(name string) func(r *http.Request) (string, error)
- func IntPathParam(name string) func(r *http.Request) (int, error)
- func IntQueryParam(name string) func(r *http.Request) (int, error)
- func JSONBody[T any]() func(r *http.Request) (T, error)
- func JSONBodyDecode[T any](r *http.Request) (T, error)
- func LogRequestError(logger Logger, err error, args ...any)
- func LogResponse(logger Logger, status int, args ...any)
- func OptionalBearerToken(r *http.Request) (string, error)
- func OptionalFormValue(name string) func(r *http.Request) (string, error)
- func OptionalHeaderValue(name string) func(r *http.Request) (string, error)
- func OptionalQueryParam(name string) func(r *http.Request) (string, error)
- func ParsedPathParam[T any](name string, parser func(string) (T, error)) func(r *http.Request) (T, error)
- func ParsedQueryParam[T any](name string, parser func(string) (T, error)) func(r *http.Request) (T, error)
- func PathParam(name string) func(r *http.Request) (string, error)
- func QueryParam(name string) func(r *http.Request) (string, error)
- func QueryParams(r *http.Request) (url.Values, error)
- func Redirect(url string, code int) *redirectResponder
- func WithDecodeErrorHandler(handler func(stage int, err error) Responder) func(*PipelineOptions)
- func WithDecodeFunc[T any](decodeFunc RequestDecodeFunc[T]) func(*handleWithInput[T])
- func WithInputErrorHandler(handler func(err error) Responder) func(*PipelineOptions)
- func WriteInternalServerError(w http.ResponseWriter, logger Logger, err error, args ...any)
- type Logger
- type MultipartFile
- type Pipeline1
- type Pipeline2
- type Pipeline3
- type Pipeline4
- type Pipeline5
- type Pipeline6
- type Pipeline7
- type Pipeline8
- type PipelineOptions
- type PipelineWithInput1
- type PipelineWithInput2
- type PipelineWithInput3
- type PipelineWithInput4
- type PipelineWithInput5
- type PipelineWithInput6
- type PipelineWithInput7
- type PipelineWithInput8
- type RequestDecodeFunc
- type RequestHandler
- type RequestHandlerWithInput
- type Responder
- type ResponderFunc
Constants ¶
This section is empty.
Variables ¶
var ErrJSONDecode = errors.New("fail to decode json")
Functions ¶
func BasicAuth ¶ added in v0.3.0
BasicAuth returns a decoder that extracts username and password from Basic Auth
func BearerToken ¶ added in v0.3.0
BearerToken returns a decoder that extracts a bearer token from the Authorization header
func BoolQueryParam ¶ added in v0.3.0
BoolQueryParam returns a decoder that extracts a query parameter as a boolean
func Combine2 ¶ added in v0.3.0
func Combine2[T1, T2 any]( decoder1 func(r *http.Request) (T1, error), decoder2 func(r *http.Request) (T2, error), ) func(r *http.Request) (struct { V1 T1 V2 T2 }, error)
Combine2 combines two decoders into a single decoder that returns a struct with both results
func FloatQueryParam ¶ added in v0.3.0
FloatQueryParam returns a decoder that extracts a query parameter as a float64
func FormFile ¶ added in v0.3.0
func FormFile(name string) func(r *http.Request) (*MultipartFile, error)
func Handle ¶
func Handle(handler RequestHandler) http.HandlerFunc
Handle converts a RequestHandler to an http.HandlerFunc.
func HandlePipeline1 ¶ added in v0.3.0
func HandlePipeline1[C any]( p Pipeline1[C], handler func(ctx context.Context, val C) Responder, ) http.HandlerFunc
HandlePipeline1 creates a handler using a pipeline with one context
func HandlePipeline2 ¶ added in v0.3.0
func HandlePipeline2[C1, C2 any]( p Pipeline2[C1, C2], handler func(ctx context.Context, val1 C1, val2 C2) Responder, ) http.HandlerFunc
HandlePipeline2 creates a handler using a pipeline with two contexts
func HandlePipeline3 ¶ added in v0.3.0
func HandlePipeline3[C1, C2, C3 any]( p Pipeline3[C1, C2, C3], handler func(ctx context.Context, val1 C1, val2 C2, val3 C3) Responder, ) http.HandlerFunc
HandlePipeline3 creates a handler using a pipeline with three contexts
func HandlePipeline4 ¶ added in v0.3.0
func HandlePipeline4[C1, C2, C3, C4 any]( p Pipeline4[C1, C2, C3, C4], handler func(ctx context.Context, val1 C1, val2 C2, val3 C3, val4 C4) Responder, ) http.HandlerFunc
HandlePipeline4 creates a handler using a pipeline with four contexts
func HandlePipeline5 ¶ added in v0.3.0
func HandlePipeline5[C1, C2, C3, C4, C5 any]( p Pipeline5[C1, C2, C3, C4, C5], handler func(ctx context.Context, val1 C1, val2 C2, val3 C3, val4 C4, val5 C5) Responder, ) http.HandlerFunc
HandlePipeline5 creates a handler using a pipeline with five contexts
func HandlePipeline6 ¶ added in v0.3.0
func HandlePipeline6[C1, C2, C3, C4, C5, C6 any]( p Pipeline6[C1, C2, C3, C4, C5, C6], handler func(ctx context.Context, val1 C1, val2 C2, val3 C3, val4 C4, val5 C5, val6 C6) Responder, ) http.HandlerFunc
HandlePipeline6 creates a handler using a pipeline with six contexts
func HandlePipeline7 ¶ added in v0.3.0
func HandlePipeline7[C1, C2, C3, C4, C5, C6, C7 any]( p Pipeline7[C1, C2, C3, C4, C5, C6, C7], handler func(ctx context.Context, val1 C1, val2 C2, val3 C3, val4 C4, val5 C5, val6 C6, val7 C7) Responder, ) http.HandlerFunc
HandlePipeline7 creates a handler using a pipeline with seven contexts
func HandlePipeline8 ¶ added in v0.3.0
func HandlePipeline8[C1, C2, C3, C4, C5, C6, C7, C8 any]( p Pipeline8[C1, C2, C3, C4, C5, C6, C7, C8], handler func(ctx context.Context, val1 C1, val2 C2, val3 C3, val4 C4, val5 C5, val6 C6, val7 C7, val8 C8) Responder, ) http.HandlerFunc
HandlePipeline8 creates a handler using a pipeline with eight contexts
func HandlePipelineWithInput1 ¶ added in v0.3.0
func HandlePipelineWithInput1[C, T any]( p Pipeline1[C], inputDecoder func(r *http.Request) (T, error), handler func(ctx context.Context, val C, input T) Responder, ) http.HandlerFunc
HandlePipelineWithInput1 creates a handler with one context and input as a pipeline stage
func HandlePipelineWithInput2 ¶ added in v0.3.0
func HandlePipelineWithInput2[C1, C2, T any]( p Pipeline2[C1, C2], inputDecoder func(r *http.Request) (T, error), handler func(ctx context.Context, val1 C1, val2 C2, input T) Responder, ) http.HandlerFunc
HandlePipelineWithInput2 creates a handler with two contexts and input as a pipeline stage
func HandlePipelineWithInput3 ¶ added in v0.3.0
func HandlePipelineWithInput3[C1, C2, C3, T any]( p Pipeline3[C1, C2, C3], inputDecoder func(r *http.Request) (T, error), handler func(ctx context.Context, val1 C1, val2 C2, val3 C3, input T) Responder, ) http.HandlerFunc
HandlePipelineWithInput3 creates a handler with three contexts and input as a pipeline stage
func HandlePipelineWithInput4 ¶ added in v0.3.0
func HandlePipelineWithInput4[C1, C2, C3, C4, T any]( p Pipeline4[C1, C2, C3, C4], inputDecoder func(r *http.Request) (T, error), handler func(ctx context.Context, val1 C1, val2 C2, val3 C3, val4 C4, input T) Responder, ) http.HandlerFunc
HandlePipelineWithInput4 creates a handler with four contexts and input as a pipeline stage
func HandlePipelineWithInput5 ¶ added in v0.3.0
func HandlePipelineWithInput5[C1, C2, C3, C4, C5, T any]( p Pipeline5[C1, C2, C3, C4, C5], inputDecoder func(r *http.Request) (T, error), handler func(ctx context.Context, val1 C1, val2 C2, val3 C3, val4 C4, val5 C5, input T) Responder, ) http.HandlerFunc
HandlePipelineWithInput5 creates a handler with five contexts and input as a pipeline stage
func HandlePipelineWithInput6 ¶ added in v0.3.0
func HandlePipelineWithInput6[C1, C2, C3, C4, C5, C6, T any]( p Pipeline6[C1, C2, C3, C4, C5, C6], inputDecoder func(r *http.Request) (T, error), handler func(ctx context.Context, val1 C1, val2 C2, val3 C3, val4 C4, val5 C5, val6 C6, input T) Responder, ) http.HandlerFunc
HandlePipelineWithInput6 creates a handler with six contexts and input as a pipeline stage
func HandlePipelineWithInput7 ¶ added in v0.3.0
func HandlePipelineWithInput7[C1, C2, C3, C4, C5, C6, C7, T any]( p Pipeline7[C1, C2, C3, C4, C5, C6, C7], inputDecoder func(r *http.Request) (T, error), handler func(ctx context.Context, val1 C1, val2 C2, val3 C3, val4 C4, val5 C5, val6 C6, val7 C7, input T) Responder, ) http.HandlerFunc
HandlePipelineWithInput7 creates a handler with seven contexts and input as a pipeline stage
func HandlePipelineWithInput8 ¶ added in v0.3.0
func HandlePipelineWithInput8[C1, C2, C3, C4, C5, C6, C7, C8, T any]( p Pipeline8[C1, C2, C3, C4, C5, C6, C7, C8], inputDecoder func(r *http.Request) (T, error), handler func(ctx context.Context, val1 C1, val2 C2, val3 C3, val4 C4, val5 C5, val6 C6, val7 C7, val8 C8, input T) Responder, ) http.HandlerFunc
HandlePipelineWithInput8 creates a handler with eight contexts and input as a pipeline stage
func HandleWithInput ¶
func HandleWithInput[T any](handler RequestHandlerWithInput[T], opts ...func(*handleWithInput[T])) http.HandlerFunc
HandleWithInput converts a RequestHandlerWithInput to an http.HandlerFunc.
func HeaderValue ¶ added in v0.3.0
HeaderValue returns a decoder that extracts a specific header value
func IntPathParam ¶ added in v0.3.0
IntPathParam returns a decoder that extracts a path parameter as an integer
func IntQueryParam ¶ added in v0.3.0
IntQueryParam returns a decoder that extracts a query parameter as an integer
func LogRequestError ¶ added in v0.3.0
LogRequestError logs an error if a logger is provided.
func LogResponse ¶ added in v0.3.0
LogResponse logs the response status if a logger is provided.
func OptionalBearerToken ¶ added in v0.3.0
OptionalBearerToken returns a decoder that extracts a bearer token if present
func OptionalFormValue ¶ added in v0.3.0
OptionalFormValue returns a decoder that extracts a form value if present
func OptionalHeaderValue ¶ added in v0.3.0
OptionalHeaderValue returns a decoder that extracts a header value if present
func OptionalQueryParam ¶ added in v0.3.0
OptionalQueryParam returns a decoder that extracts a query parameter value if present
func ParsedPathParam ¶ added in v0.3.0
func ParsedPathParam[T any](name string, parser func(string) (T, error)) func(r *http.Request) (T, error)
ParsedPathParam returns a decoder that extracts and parses a path parameter to a specific type
func ParsedQueryParam ¶ added in v0.3.0
func ParsedQueryParam[T any](name string, parser func(string) (T, error)) func(r *http.Request) (T, error)
ParsedQueryParam returns a decoder that extracts and parses a query parameter to a specific type
func PathParam ¶ added in v0.3.0
PathParam returns a decoder that extracts a path parameter value This works with Go 1.22's r.PathValue() method
func QueryParam ¶ added in v0.3.0
QueryParam returns a decoder that extracts a query parameter value
func QueryParams ¶ added in v0.3.0
QueryParams returns a decoder that extracts all query parameters
func WithDecodeErrorHandler ¶ added in v0.3.0
func WithDecodeErrorHandler(handler func(stage int, err error) Responder) func(*PipelineOptions)
WithDecodeErrorHandler returns an option that sets a custom context error handler
func WithDecodeFunc ¶
func WithDecodeFunc[T any](decodeFunc RequestDecodeFunc[T]) func(*handleWithInput[T])
WithDecodeFunc sets the decode function for the handler.
func WithInputErrorHandler ¶ added in v0.3.0
func WithInputErrorHandler(handler func(err error) Responder) func(*PipelineOptions)
WithInputErrorHandler returns an option that sets a custom input error handler
func WriteInternalServerError ¶ added in v0.3.0
func WriteInternalServerError(w http.ResponseWriter, logger Logger, err error, args ...any)
WriteInternalServerError writes an HTTP 500 Internal Server Error response. If a logger is provided, it will also log the error.
Types ¶
type MultipartFile ¶ added in v0.3.0
type MultipartFile struct {
File multipart.File
Header *multipart.FileHeader
}
FormFile returns a decoder that extracts a file from a multipart form
type Pipeline1 ¶ added in v0.3.0
type Pipeline1[C any] struct { // contains filtered or unexported fields }
Pipeline1 is a pipeline with one context type
func NewPipeline1 ¶ added in v0.3.0
func NewPipeline1[C any]( decoder func(r *http.Request) (C, error), options ...func(*PipelineOptions), ) Pipeline1[C]
NewPipeline1 creates a pipeline with one context type
type Pipeline2 ¶ added in v0.3.0
type Pipeline2[C1, C2 any] struct { // contains filtered or unexported fields }
Pipeline2 is a pipeline with two context types
type Pipeline3 ¶ added in v0.3.0
type Pipeline3[C1, C2, C3 any] struct { // contains filtered or unexported fields }
Pipeline3 is a pipeline with three context types
func NewPipeline3 ¶ added in v0.3.0
func NewPipeline3[C1, C2, C3 any]( decoder1 func(r *http.Request) (C1, error), decoder2 func(r *http.Request, c1 C1) (C2, error), decoder3 func(r *http.Request, c1 C1, c2 C2) (C3, error), options ...func(*PipelineOptions), ) Pipeline3[C1, C2, C3]
NewPipeline3 creates a pipeline with three context types
type Pipeline4 ¶ added in v0.3.0
type Pipeline4[C1, C2, C3, C4 any] struct { // contains filtered or unexported fields }
Pipeline4 is a pipeline with four context types
func NewPipeline4 ¶ added in v0.3.0
func NewPipeline4[C1, C2, C3, C4 any]( decoder1 func(r *http.Request) (C1, error), decoder2 func(r *http.Request, c1 C1) (C2, error), decoder3 func(r *http.Request, c1 C1, c2 C2) (C3, error), decoder4 func(r *http.Request, c1 C1, c2 C2, c3 C3) (C4, error), options ...func(*PipelineOptions), ) Pipeline4[C1, C2, C3, C4]
NewPipeline4 creates a pipeline with four context types
type Pipeline5 ¶ added in v0.3.0
type Pipeline5[C1, C2, C3, C4, C5 any] struct { // contains filtered or unexported fields }
Pipeline5 is a pipeline with five context types
func NewPipeline5 ¶ added in v0.3.0
func NewPipeline5[C1, C2, C3, C4, C5 any]( decoder1 func(r *http.Request) (C1, error), decoder2 func(r *http.Request, c1 C1) (C2, error), decoder3 func(r *http.Request, c1 C1, c2 C2) (C3, error), decoder4 func(r *http.Request, c1 C1, c2 C2, c3 C3) (C4, error), decoder5 func(r *http.Request, c1 C1, c2 C2, c3 C3, c4 C4) (C5, error), options ...func(*PipelineOptions), ) Pipeline5[C1, C2, C3, C4, C5]
NewPipeline5 creates a pipeline with five context types
type Pipeline6 ¶ added in v0.3.0
type Pipeline6[C1, C2, C3, C4, C5, C6 any] struct { // contains filtered or unexported fields }
Pipeline6 is a pipeline with six context types
func NewPipeline6 ¶ added in v0.3.0
func NewPipeline6[C1, C2, C3, C4, C5, C6 any]( decoder1 func(r *http.Request) (C1, error), decoder2 func(r *http.Request, c1 C1) (C2, error), decoder3 func(r *http.Request, c1 C1, c2 C2) (C3, error), decoder4 func(r *http.Request, c1 C1, c2 C2, c3 C3) (C4, error), decoder5 func(r *http.Request, c1 C1, c2 C2, c3 C3, c4 C4) (C5, error), decoder6 func(r *http.Request, c1 C1, c2 C2, c3 C3, c4 C4, c5 C5) (C6, error), options ...func(*PipelineOptions), ) Pipeline6[C1, C2, C3, C4, C5, C6]
NewPipeline6 creates a pipeline with six context types
type Pipeline7 ¶ added in v0.3.0
type Pipeline7[C1, C2, C3, C4, C5, C6, C7 any] struct { // contains filtered or unexported fields }
Pipeline7 is a pipeline with seven context types
func NewPipeline7 ¶ added in v0.3.0
func NewPipeline7[C1, C2, C3, C4, C5, C6, C7 any]( decoder1 func(r *http.Request) (C1, error), decoder2 func(r *http.Request, c1 C1) (C2, error), decoder3 func(r *http.Request, c1 C1, c2 C2) (C3, error), decoder4 func(r *http.Request, c1 C1, c2 C2, c3 C3) (C4, error), decoder5 func(r *http.Request, c1 C1, c2 C2, c3 C3, c4 C4) (C5, error), decoder6 func(r *http.Request, c1 C1, c2 C2, c3 C3, c4 C4, c5 C5) (C6, error), decoder7 func(r *http.Request, c1 C1, c2 C2, c3 C3, c4 C4, c5 C5, c6 C6) (C7, error), options ...func(*PipelineOptions), ) Pipeline7[C1, C2, C3, C4, C5, C6, C7]
NewPipeline7 creates a pipeline with seven context types
type Pipeline8 ¶ added in v0.3.0
type Pipeline8[C1, C2, C3, C4, C5, C6, C7, C8 any] struct { // contains filtered or unexported fields }
Pipeline8 is a pipeline with eight context types
func NewPipeline8 ¶ added in v0.3.0
func NewPipeline8[C1, C2, C3, C4, C5, C6, C7, C8 any]( decoder1 func(r *http.Request) (C1, error), decoder2 func(r *http.Request, c1 C1) (C2, error), decoder3 func(r *http.Request, c1 C1, c2 C2) (C3, error), decoder4 func(r *http.Request, c1 C1, c2 C2, c3 C3) (C4, error), decoder5 func(r *http.Request, c1 C1, c2 C2, c3 C3, c4 C4) (C5, error), decoder6 func(r *http.Request, c1 C1, c2 C2, c3 C3, c4 C4, c5 C5) (C6, error), decoder7 func(r *http.Request, c1 C1, c2 C2, c3 C3, c4 C4, c5 C5, c6 C6) (C7, error), decoder8 func(r *http.Request, c1 C1, c2 C2, c3 C3, c4 C4, c5 C5, c6 C6, c7 C7) (C8, error), options ...func(*PipelineOptions), ) Pipeline8[C1, C2, C3, C4, C5, C6, C7, C8]
NewPipeline8 creates a pipeline with eight context types
type PipelineOptions ¶ added in v0.3.0
type PipelineOptions struct {
// DecodeErrorHandler handles errors from context decoders
DecodeErrorHandler func(stage int, err error) Responder
// InputErrorHandler handles errors from input decoders
InputErrorHandler func(err error) Responder
}
PipelineOptions holds configurable options for pipelines
type PipelineWithInput1 ¶ added in v0.3.0
type PipelineWithInput1[C, T any] struct { // contains filtered or unexported fields }
PipelineWithInput1 is a pipeline stage with one context and input
func NewPipelineWithInput1 ¶ added in v0.3.0
func NewPipelineWithInput1[C, T any]( p Pipeline1[C], inputDecoder func(r *http.Request) (T, error), options ...func(*PipelineOptions), ) PipelineWithInput1[C, T]
NewPipelineWithInput1 creates a pipeline with one context type and input
type PipelineWithInput2 ¶ added in v0.3.0
type PipelineWithInput2[C1, C2, T any] struct { // contains filtered or unexported fields }
PipelineWithInput2 is a pipeline stage with two contexts and input
func NewPipelineWithInput2 ¶ added in v0.3.0
func NewPipelineWithInput2[C1, C2, T any]( p Pipeline2[C1, C2], inputDecoder func(r *http.Request) (T, error), options ...func(*PipelineOptions), ) PipelineWithInput2[C1, C2, T]
NewPipelineWithInput2 creates a pipeline with two context types and input
type PipelineWithInput3 ¶ added in v0.3.0
type PipelineWithInput3[C1, C2, C3, T any] struct { // contains filtered or unexported fields }
PipelineWithInput3 is a pipeline stage with three contexts and input
func NewPipelineWithInput3 ¶ added in v0.3.0
func NewPipelineWithInput3[C1, C2, C3, T any]( p Pipeline3[C1, C2, C3], inputDecoder func(r *http.Request) (T, error), options ...func(*PipelineOptions), ) PipelineWithInput3[C1, C2, C3, T]
NewPipelineWithInput3 creates a pipeline with three context types and input
type PipelineWithInput4 ¶ added in v0.3.0
type PipelineWithInput4[C1, C2, C3, C4, T any] struct { // contains filtered or unexported fields }
PipelineWithInput4 is a pipeline stage with four contexts and input
func NewPipelineWithInput4 ¶ added in v0.3.0
func NewPipelineWithInput4[C1, C2, C3, C4, T any]( p Pipeline4[C1, C2, C3, C4], inputDecoder func(r *http.Request) (T, error), options ...func(*PipelineOptions), ) PipelineWithInput4[C1, C2, C3, C4, T]
NewPipelineWithInput4 creates a pipeline with four context types and input
type PipelineWithInput5 ¶ added in v0.3.0
type PipelineWithInput5[C1, C2, C3, C4, C5, T any] struct { // contains filtered or unexported fields }
PipelineWithInput5 is a pipeline stage with five contexts and input
func NewPipelineWithInput5 ¶ added in v0.3.0
func NewPipelineWithInput5[C1, C2, C3, C4, C5, T any]( p Pipeline5[C1, C2, C3, C4, C5], inputDecoder func(r *http.Request) (T, error), options ...func(*PipelineOptions), ) PipelineWithInput5[C1, C2, C3, C4, C5, T]
NewPipelineWithInput5 creates a pipeline with five context types and input
type PipelineWithInput6 ¶ added in v0.3.0
type PipelineWithInput6[C1, C2, C3, C4, C5, C6, T any] struct { // contains filtered or unexported fields }
PipelineWithInput6 is a pipeline stage with six contexts and input
func NewPipelineWithInput6 ¶ added in v0.3.0
func NewPipelineWithInput6[C1, C2, C3, C4, C5, C6, T any]( p Pipeline6[C1, C2, C3, C4, C5, C6], inputDecoder func(r *http.Request) (T, error), options ...func(*PipelineOptions), ) PipelineWithInput6[C1, C2, C3, C4, C5, C6, T]
NewPipelineWithInput6 creates a pipeline with six context types and input
type PipelineWithInput7 ¶ added in v0.3.0
type PipelineWithInput7[C1, C2, C3, C4, C5, C6, C7, T any] struct { // contains filtered or unexported fields }
PipelineWithInput7 is a pipeline stage with seven contexts and input
func NewPipelineWithInput7 ¶ added in v0.3.0
func NewPipelineWithInput7[C1, C2, C3, C4, C5, C6, C7, T any]( p Pipeline7[C1, C2, C3, C4, C5, C6, C7], inputDecoder func(r *http.Request) (T, error), options ...func(*PipelineOptions), ) PipelineWithInput7[C1, C2, C3, C4, C5, C6, C7, T]
NewPipelineWithInput7 creates a pipeline with seven context types and input
type PipelineWithInput8 ¶ added in v0.3.0
type PipelineWithInput8[C1, C2, C3, C4, C5, C6, C7, C8, T any] struct { // contains filtered or unexported fields }
PipelineWithInput8 is a pipeline stage with eight contexts and input
func NewPipelineWithInput8 ¶ added in v0.3.0
func NewPipelineWithInput8[C1, C2, C3, C4, C5, C6, C7, C8, T any]( p Pipeline8[C1, C2, C3, C4, C5, C6, C7, C8], inputDecoder func(r *http.Request) (T, error), options ...func(*PipelineOptions), ) PipelineWithInput8[C1, C2, C3, C4, C5, C6, C7, C8, T]
NewPipelineWithInput8 creates a pipeline with eight context types and input
type RequestDecodeFunc ¶
RequestDecodeFunc defines how to decode an HTTP request.
type RequestHandler ¶
RequestHandler handles an HTTP request and returns a Responder.
type RequestHandlerWithInput ¶
RequestHandlerWithInput handles an HTTP request with decoded input and returns a Responder.
type Responder ¶
type Responder interface {
Respond(w http.ResponseWriter, r *http.Request)
}
Responder defines how to respond to HTTP requests.
type ResponderFunc ¶ added in v0.3.0
type ResponderFunc func(w http.ResponseWriter, r *http.Request)
ResponderFunc is a function type that implements the Responder interface
func (ResponderFunc) Respond ¶ added in v0.3.0
func (f ResponderFunc) Respond(w http.ResponseWriter, r *http.Request)
Respond implements the Responder interface