Documentation ¶
Index ¶
- Variables
- type Kernel
- func (k *Kernel) FastHttpHandler(ctx *fasthttp.RequestCtx)
- func (k *Kernel) Handle(r contract.RequestContract) (resp contract.ResponseContract)
- func (k *Kernel) IsKeepAlive() bool
- func (k *Kernel) KeepAlive(b ...bool) *Kernel
- func (k *Kernel) SendRequestToRouter(r contract.RequestContract) contract.ResponseContract
- func (k *Kernel) SetErrorHandler(handler errors.ErrorHandler)
- func (k *Kernel) SetMiddleware(ms []RequestMiddleware)
- func (k *Kernel) SetMiddlewareGroup(middlewareGroup map[string][]RequestMiddleware)
- type KernelContact
- type MiddlewareGroup
- type PipeFunc
- type PipeHandler
- type Pipeline
- func (p *Pipeline) Send(r contract.RequestContract) *Pipeline
- func (p *Pipeline) Then(handler PipeHandler) contract.ResponseContract
- func (p *Pipeline) Through(pipe interface{}) *Pipeline
- func (p *Pipeline) ThroughFunc(pipe PipeFunc) *Pipeline
- func (p *Pipeline) ThroughMiddleware(pipe RequestMiddleware) *Pipeline
- type RequestMiddleware
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ServerName = "valyala/fasthttp"
)
Functions ¶
This section is empty.
Types ¶
type Kernel ¶
func (*Kernel) FastHttpHandler ¶
func (k *Kernel) FastHttpHandler(ctx *fasthttp.RequestCtx)
func (*Kernel) Handle ¶
func (k *Kernel) Handle(r contract.RequestContract) (resp contract.ResponseContract)
func (*Kernel) IsKeepAlive ¶
func (*Kernel) SendRequestToRouter ¶
func (k *Kernel) SendRequestToRouter(r contract.RequestContract) contract.ResponseContract
func (*Kernel) SetErrorHandler ¶
func (k *Kernel) SetErrorHandler(handler errors.ErrorHandler)
func (*Kernel) SetMiddleware ¶
func (k *Kernel) SetMiddleware(ms []RequestMiddleware)
func (*Kernel) SetMiddlewareGroup ¶
func (k *Kernel) SetMiddlewareGroup(middlewareGroup map[string][]RequestMiddleware)
type KernelContact ¶
type KernelContact interface { Handle(r contract.RequestContract) (resp contract.ResponseContract) SetMiddleware(ms []RequestMiddleware) FastHttpHandler(ctx *fasthttp.RequestCtx) }
/KernelContact is interface of http kernel
type MiddlewareGroup ¶
type MiddlewareGroup map[string][]RequestMiddleware
type PipeFunc ¶
type PipeFunc func(r contract.RequestContract, next PipeHandler) contract.ResponseContract
PipeFunc request middleware function
type PipeHandler ¶
type PipeHandler func(r contract.RequestContract) contract.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 contract.RequestContract) *Pipeline
Send request to pipeline
func (*Pipeline) Then ¶
func (p *Pipeline) Then(handler PipeHandler) contract.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(r contract.RequestContract, next PipeHandler) contract.ResponseContract
}
RequestMiddleware request middleware
Click to show internal directories.
Click to hide internal directories.