http

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ServerName = "valyala/fasthttp"
)

Functions

This section is empty.

Types

type Kernel

type Kernel struct {
	RequestCurrency int
	OutputLog       bool
	// contains filtered or unexported fields
}

func NewKernel

func NewKernel(router *router.Router, app *kernel.Application) *Kernel

func (*Kernel) FastHttpHandler

func (k *Kernel) FastHttpHandler(ctx *fasthttp.RequestCtx)

func (*Kernel) Handle

func (*Kernel) IsKeepAlive

func (k *Kernel) IsKeepAlive() bool

func (*Kernel) KeepAlive

func (k *Kernel) KeepAlive(b ...bool) *Kernel

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

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

func (p *Pipeline) Then(handler PipeHandler) contract.ResponseContract

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(r contract.RequestContract, next PipeHandler) contract.ResponseContract
}

RequestMiddleware request middleware

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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