http

package
v0.0.0-...-f3ad2b4 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2015 License: MIT Imports: 23 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticationMiddleware

func AuthenticationMiddleware(registry kit.Registry, r kit.Request) (kit.Response, bool)

func HttpHandler

func HttpHandler(w http.ResponseWriter, r *http.Request, params httprouter.Params, registry kit.Registry, handler kit.RequestHandler)

func MarshalResponseMiddleware

func MarshalResponseMiddleware(registry kit.Registry, request kit.Request, response kit.Response) (kit.Response, bool)

func RespondWithContent

func RespondWithContent(app kit.App, w http.ResponseWriter, code int, content []byte)

func RespondWithJson

func RespondWithJson(w http.ResponseWriter, response kit.Response)

func RespondWithReader

func RespondWithReader(app kit.App, w http.ResponseWriter, code int, reader io.ReadCloser)

func ServerErrorMiddleware

func ServerErrorMiddleware(registry kit.Registry, r kit.Request, response kit.Response) (kit.Response, bool)

func UnserializeRequestMiddleware

func UnserializeRequestMiddleware(registry kit.Registry, request kit.Request) (kit.Response, bool)

Types

type Frontend

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

func New

func New(registry kit.Registry) *Frontend

func (*Frontend) AfterMiddlewares

func (f *Frontend) AfterMiddlewares() []kit.AfterRequestMiddleware

func (*Frontend) BeforeMiddlewares

func (f *Frontend) BeforeMiddlewares() []kit.RequestHandler

func (*Frontend) Debug

func (f *Frontend) Debug() bool

func (*Frontend) Init

func (f *Frontend) Init() apperror.Error

func (*Frontend) Logger

func (f *Frontend) Logger() *logrus.Logger

func (Frontend) Name

func (Frontend) Name() string

func (*Frontend) NotFoundHandler

func (f *Frontend) NotFoundHandler() kit.RequestHandler

func (*Frontend) RegisterAfterMiddleware

func (f *Frontend) RegisterAfterMiddleware(middleware kit.AfterRequestMiddleware)

func (*Frontend) RegisterBeforeMiddleware

func (f *Frontend) RegisterBeforeMiddleware(handler kit.RequestHandler)

func (*Frontend) RegisterHttpHandler

func (f *Frontend) RegisterHttpHandler(method, path string, handler kit.RequestHandler)

func (*Frontend) Registry

func (f *Frontend) Registry() kit.Registry

func (*Frontend) Router

func (f *Frontend) Router() *httprouter.Router

func (*Frontend) ServeFiles

func (f *Frontend) ServeFiles(route string, path string)

func (*Frontend) SetAfterMiddlewares

func (f *Frontend) SetAfterMiddlewares(middlewares []kit.AfterRequestMiddleware)

func (*Frontend) SetBeforeMiddlewares

func (f *Frontend) SetBeforeMiddlewares(middlewares []kit.RequestHandler)

func (*Frontend) SetDebug

func (f *Frontend) SetDebug(x bool)

func (*Frontend) SetNotFoundHandler

func (f *Frontend) SetNotFoundHandler(x kit.RequestHandler)

func (*Frontend) SetRegistry

func (f *Frontend) SetRegistry(x kit.Registry)

func (*Frontend) Shutdown

func (f *Frontend) Shutdown() (shutdownChan chan bool, err apperror.Error)

func (*Frontend) Start

func (f *Frontend) Start() apperror.Error

type HttpHandlerStruct

type HttpHandlerStruct struct {
	Registry kit.Registry
	Handler  kit.RequestHandler
}

func (*HttpHandlerStruct) ServeHTTP

func (h *HttpHandlerStruct) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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