http

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2020 License: MIT Imports: 20 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
	MaxRequestBodySize 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 contracts.RequestContract) contracts.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 contracts.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

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 RequestInjector added in v0.0.2

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

RequestInjector inject request object, with validation

func (RequestInjector) Injection added in v0.0.2

func (r RequestInjector) Injection(abs interface{}, last reflect.Value) (reflect.Value, error)

func (RequestInjector) When added in v0.0.2

func (r RequestInjector) When(abs interface{}) bool

type RequestMiddleware

type RequestMiddleware interface {
	Handle(r contracts.RequestContract, next PipeHandler) contracts.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