context

package
v0.0.0-...-d22e7c3 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Constructor

type Constructor struct {
	HTTPResponseWriter http.ResponseWriter
	HTTPRequest        *http.Request
	Address            string
	Path               string
	Method             string
}

Constructor of context

type RequestContext

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

RequestContext struct

func New

func New(constructor Constructor) *RequestContext

New context

func (*RequestContext) Address

func (rc *RequestContext) Address() string

Address return the address where request arrived to

func (*RequestContext) Context

func (rc *RequestContext) Context() context.Context

Context return the http.Request.Context

func (*RequestContext) DecodeJSON

func (rc *RequestContext) DecodeJSON(out interface{}) error

DecodeJSON from request body

func (*RequestContext) JSON

func (rc *RequestContext) JSON() *response.JSONResponse

JSON to create a json response via http response lib

func (*RequestContext) Request

func (rc *RequestContext) Request() *http.Request

Request return http request from request context

func (*RequestContext) RequestHandler

func (rc *RequestContext) RequestHandler() string

RequestHandler return handler name of the request

func (*RequestContext) RequestHeader

func (rc *RequestContext) RequestHeader() http.Header

RequestHeader return http.Request.Header

func (*RequestContext) ResponseWriter

func (rc *RequestContext) ResponseWriter() http.ResponseWriter

ResponseWriter return http response writer from request context

Jump to

Keyboard shortcuts

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