middleware

package
v0.3.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppendAppMiddleware

type AppendAppMiddleware struct{}

func (AppendAppMiddleware) Handle

func (a AppendAppMiddleware) Handle(request inter.Request, next inter.Next) inter.Response

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(destination inter.Next) inter.Response

Run the contract with a final destination callback.

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.

Jump to

Keyboard shortcuts

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