pipeline

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: BSD-3-Clause Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MiddlewareChain

func MiddlewareChain(mid ...RequestMiddleware) middlewareChain

Types

type FuncMiddleware added in v1.1.3

type FuncMiddleware struct {
	HandleFunc PipeFunc
}

func (FuncMiddleware) Handle added in v1.1.3

type MiddlewareGroup

type MiddlewareGroup map[string][]RequestMiddleware

type PipeFunc

type PipeFunc func(request contracts.RequestContract, next PipeHandler) contracts.ResponseContract

PipeFunc request middleware function

type PipeHandler

PipeHandler destination handler

type Pipeline

type Pipeline struct {
	// contains filtered or unexported fields
}

Pipeline is request pipeline prepare for request middleware

func (*Pipeline) Send

Send request to pipeline

func (*Pipeline) Then

Then final destination

func (*Pipeline) Through

func (p *Pipeline) Through(pipe interface{}) *Pipeline

Through middleware

func (*Pipeline) ThroughFunc

func (p *Pipeline) ThroughFunc(pipe PipeFunc) *Pipeline

ThroughFunc through middleware function

func (*Pipeline) ThroughMiddleware

func (p *Pipeline) ThroughMiddleware(pipe RequestMiddleware) *Pipeline

ThroughMiddleware through middleware struct

type RequestMiddleware

type RequestMiddleware interface {
	Handle(request contracts.RequestContract, next PipeHandler) contracts.ResponseContract
}

RequestMiddleware request middleware

type ResponsePipe added in v1.1.3

type ResponsePipe struct {
	// contains filtered or unexported fields
}

func NewResponsePipe added in v1.1.3

func NewResponsePipe() *ResponsePipe

func (*ResponsePipe) Handle added in v1.1.3

func (*ResponsePipe) Pipe added in v1.1.3

func (rp *ResponsePipe) Pipe(pipeFunc PipeFunc) *ResponsePipe

Jump to

Keyboard shortcuts

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