http

package
v0.0.0-...-f198145 Latest Latest
Warning

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

Go to latest
Published: May 7, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoRequestBodyDecoderFoundError = errors.WithStatus(errors.WithLevel(errors.New("unsupported content type or HTTP method"),
	log_level.DEBUG),
	net.StatusUnsupportedMediaType)

Functions

func HandleHttpKernel

func HandleHttpKernel(app inter.App, response net.ResponseWriter, request *net.Request)

func NewRequest

func NewRequest(options Options) inter.Request

Types

type Kernel

type Kernel struct {
	App *inter.App
}

func (Kernel) Handle

func (k Kernel) Handle(request inter.Request) inter.Response

Handle an incoming HTTP request.

func (Kernel) RecoverFromMiddlewarePanic

func (k Kernel) RecoverFromMiddlewarePanic(recover interface{}) inter.Response

type Options

type Options struct {
	App     inter.App
	Source  http.Request
	Method  string
	Host    string
	Url     string
	Header  http.Header
	Form    url.Values
	Content string
	Route   *mux.Route
	Body    io.ReadCloser
}

type Request

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

func (Request) App

func (r Request) App() inter.App

func (Request) Body

func (r Request) Body() string

func (*Request) Content

func (r *Request) Content(keyInput ...string) support.Value

func (*Request) ContentE

func (r *Request) ContentE(keyInput ...string) (support.Value, error)

func (Request) ContentOr

func (r Request) ContentOr(key string, defaultValue interface{}) support.Value

func (Request) Cookie

func (r Request) Cookie(key string) string

func (Request) CookieE

func (r Request) CookieE(key string) (string, error)

func (*Request) File

func (r *Request) File(key string) support.File

func (*Request) FileE

func (r *Request) FileE(key string) (support.File, error)

func (*Request) Files

func (r *Request) Files(key string) []support.File

func (*Request) FilesE

func (r *Request) FilesE(key string) ([]support.File, error)

func (Request) FullUrl

func (r Request) FullUrl() string

func (Request) Header

func (r Request) Header(key string) string

func (Request) Headers

func (r Request) Headers() http.Header

func (*Request) Make

func (r *Request) Make(abstract interface{}) interface{}

func (*Request) MakeE

func (r *Request) MakeE(abstract interface{}) (interface{}, error)

func (Request) Method

func (r Request) Method() string

func (Request) Parameter

func (r Request) Parameter(key string) support.Value

func (Request) ParameterE

func (r Request) ParameterE(key string) (support.Value, error)

func (Request) ParameterOr

func (r Request) ParameterOr(key string, defaultValue interface{}) support.Value

func (Request) Path

func (r Request) Path() string

func (Request) Query

func (r Request) Query(key string) support.Value

func (Request) QueryE

func (r Request) QueryE(key string) (support.Value, error)

func (Request) QueryOr

func (r Request) QueryOr(key string, defaultValue interface{}) support.Value

func (Request) Route

func (r Request) Route() inter.Route

func (*Request) SetApp

func (r *Request) SetApp(app inter.App)

func (*Request) SetBody

func (r *Request) SetBody(body string) inter.Request

func (*Request) SetUrlValues

func (r *Request) SetUrlValues(vars map[string]string) inter.Request

func (Request) Source

func (r Request) Source() http.Request

func (Request) Url

func (r Request) Url() string

type Router

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

func NewRouter

func NewRouter(app inter.App) Router

func (Router) DispatchToRoute

func (r Router) DispatchToRoute(request inter.Request) inter.Response

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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