middleware

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2021 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DecorateResponse added in v0.3.1

type DecorateResponse struct{}

func (DecorateResponse) Handle added in v0.3.1

func (r DecorateResponse) Handle(request inter.Request, next inter.Next) inter.Response

type DefaultResponseOutcome added in v0.3.1

type DefaultResponseOutcome struct {
	Outcome func(content interface{}) inter.Response
}

func (DefaultResponseOutcome) Handle added in v0.3.1

func (r DefaultResponseOutcome) Handle(request inter.Request, next inter.Next) inter.Response

type PanicToResponse added in v0.3.1

type PanicToResponse struct{}

func (PanicToResponse) Handle added in v0.3.1

func (p PanicToResponse) Handle(request inter.Request, next inter.Next) (response inter.Response)

Change an error from a temporary response to a complete response

type Pipe added in v0.3.1

type Pipe interface {
	Handle(request inter.Request, next inter.Next) inter.Response
}

type Pipeline added in v0.3.1

type Pipeline struct {
	App inter.App

	// The object being passed through the contract.
	Passable inter.Request

	// the array of pipes.
	Pipes []inter.HttpMiddleware
}

noinspection GoNameStartsWithPackageName

func NewPipeline added in v0.3.1

func NewPipeline(app inter.App) Pipeline

func (Pipeline) AppPath added in v0.3.1

func (p Pipeline) AppPath() string

func (Pipeline) Send added in v0.3.1

func (p Pipeline) Send(passable inter.Request) Pipeline

Set the object being sent through the contract.

func (Pipeline) Then added in v0.3.1

func (p Pipeline) Then(controller inter.Controller) inter.Response

Run the contract with a final destination pipe holder. In this case, pipes are middlewares with a request and a response

func (Pipeline) Through added in v0.3.1

func (p Pipeline) Through(pipes []inter.HttpMiddleware) Pipeline

Set the array of pipes.

type RequestBodyDecoder added in v0.3.1

type RequestBodyDecoder struct{}

func (RequestBodyDecoder) Handle added in v0.3.1

func (r RequestBodyDecoder) Handle(request inter.Request, next inter.Next) inter.Response

This ensures the request can be decoded from JSON and Multipart Form. Feel free to add your own decoders to support other formats as well.

type RequestID added in v0.6.0

type RequestID struct{}

func (RequestID) Handle added in v0.6.0

func (_ RequestID) Handle(request inter.Request, next inter.Next) inter.Response

Jump to

Keyboard shortcuts

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