http

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HandlerFastHttp handlerType = iota
	HandlerNetHttp
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Kernel

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

func NewKernel

func NewKernel(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) ServeHTTP

func (k *Kernel) ServeHTTP(w http.ResponseWriter, r *http.Request)

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)

func (*Kernel) Wrapper

func (k *Kernel) Wrapper() *router.Wrapper

type KernelRequestResolver

type KernelRequestResolver struct {
}

func (KernelRequestResolver) ResolveRequest

func (rr KernelRequestResolver) ResolveRequest(r contract.RequestContract, runtime *kernel.Application)

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

type Service

type Service struct {
}

func (*Service) Boot

func (s *Service) Boot(app *kernel.Application)

func (*Service) Register

func (s *Service) Register(app *kernel.Application)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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