Documentation ¶
Index ¶
- func MiddlewareChain(mid ...RequestMiddleware) middlewareChain
- type FuncMiddleware
- type MiddlewareGroup
- type PipeFunc
- type PipeHandler
- type Pipeline
- func (p *Pipeline) Send(r contracts.RequestContract) *Pipeline
- func (p *Pipeline) Then(handler PipeHandler) contracts.ResponseContract
- func (p *Pipeline) Through(pipe interface{}) *Pipeline
- func (p *Pipeline) ThroughFunc(pipe PipeFunc) *Pipeline
- func (p *Pipeline) ThroughMiddleware(pipe RequestMiddleware) *Pipeline
- type RequestMiddleware
- type ResponsePipe
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
func (fm FuncMiddleware) Handle(r contracts.RequestContract, next PipeHandler) contracts.ResponseContract
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 ¶
type PipeHandler func(r contracts.RequestContract) contracts.ResponseContract
PipeHandler destination handler
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
Pipeline is request pipeline prepare for request middleware
func (*Pipeline) Send ¶
func (p *Pipeline) Send(r contracts.RequestContract) *Pipeline
Send request to pipeline
func (*Pipeline) Then ¶
func (p *Pipeline) Then(handler PipeHandler) contracts.ResponseContract
Then final destination
func (*Pipeline) ThroughFunc ¶
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 (rp *ResponsePipe) Handle(r contracts.RequestContract, next PipeHandler) contracts.ResponseContract
func (*ResponsePipe) Pipe ¶ added in v1.1.3
func (rp *ResponsePipe) Pipe(pipeFunc PipeFunc) *ResponsePipe
Click to show internal directories.
Click to hide internal directories.