Documentation ¶
Index ¶
- func AuthenticationMiddleware(registry kit.Registry, r kit.Request) (kit.Response, bool)
- func HttpHandler(w http.ResponseWriter, r *http.Request, params httprouter.Params, ...)
- func MarshalResponseMiddleware(registry kit.Registry, request kit.Request, response kit.Response) (kit.Response, bool)
- func RespondWithContent(app kit.App, w http.ResponseWriter, code int, content []byte)
- func RespondWithJson(w http.ResponseWriter, response kit.Response)
- func RespondWithReader(app kit.App, w http.ResponseWriter, code int, reader io.ReadCloser)
- func ServerErrorMiddleware(registry kit.Registry, r kit.Request, response kit.Response) (kit.Response, bool)
- func UnserializeRequestMiddleware(registry kit.Registry, request kit.Request) (kit.Response, bool)
- type Frontend
- func (f *Frontend) AfterMiddlewares() []kit.AfterRequestMiddleware
- func (f *Frontend) BeforeMiddlewares() []kit.RequestHandler
- func (f *Frontend) Debug() bool
- func (f *Frontend) Init() apperror.Error
- func (f *Frontend) Logger() *logrus.Logger
- func (Frontend) Name() string
- func (f *Frontend) NotFoundHandler() kit.RequestHandler
- func (f *Frontend) RegisterAfterMiddleware(middleware kit.AfterRequestMiddleware)
- func (f *Frontend) RegisterBeforeMiddleware(handler kit.RequestHandler)
- func (f *Frontend) RegisterHttpHandler(method, path string, handler kit.RequestHandler)
- func (f *Frontend) Registry() kit.Registry
- func (f *Frontend) Router() *httprouter.Router
- func (f *Frontend) ServeFiles(route string, path string)
- func (f *Frontend) SetAfterMiddlewares(middlewares []kit.AfterRequestMiddleware)
- func (f *Frontend) SetBeforeMiddlewares(middlewares []kit.RequestHandler)
- func (f *Frontend) SetDebug(x bool)
- func (f *Frontend) SetNotFoundHandler(x kit.RequestHandler)
- func (f *Frontend) SetRegistry(x kit.Registry)
- func (f *Frontend) Shutdown() (shutdownChan chan bool, err apperror.Error)
- func (f *Frontend) Start() apperror.Error
- type HttpHandlerStruct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HttpHandler ¶
func HttpHandler(w http.ResponseWriter, r *http.Request, params httprouter.Params, registry kit.Registry, handler kit.RequestHandler)
func RespondWithContent ¶
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 ¶
Types ¶
type Frontend ¶
type Frontend struct {
// contains filtered or unexported fields
}
func (*Frontend) AfterMiddlewares ¶
func (f *Frontend) AfterMiddlewares() []kit.AfterRequestMiddleware
func (*Frontend) BeforeMiddlewares ¶
func (f *Frontend) BeforeMiddlewares() []kit.RequestHandler
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) Router ¶
func (f *Frontend) Router() *httprouter.Router
func (*Frontend) ServeFiles ¶
func (*Frontend) SetAfterMiddlewares ¶
func (f *Frontend) SetAfterMiddlewares(middlewares []kit.AfterRequestMiddleware)
func (*Frontend) SetBeforeMiddlewares ¶
func (f *Frontend) SetBeforeMiddlewares(middlewares []kit.RequestHandler)
func (*Frontend) SetNotFoundHandler ¶
func (f *Frontend) SetNotFoundHandler(x kit.RequestHandler)
func (*Frontend) SetRegistry ¶
type HttpHandlerStruct ¶
type HttpHandlerStruct struct { Registry kit.Registry Handler kit.RequestHandler }
func (*HttpHandlerStruct) ServeHTTP ¶
func (h *HttpHandlerStruct) ServeHTTP(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.