Documentation ¶
Index ¶
- type Context
- func (context *Context) BadRequest(err error, message string, values ...interface{}) Status
- func (context *Context) Describe(key string, value string) *Context
- func (context *Context) Error(code int, err error, message string, values ...interface{}) Status
- func (context *Context) Get(name string) interface{}
- func (context *Context) GetBody() io.ReadCloser
- func (context *Context) GetID() string
- func (context *Context) GetQueryParam(key string) string
- func (context *Context) GetRequest() *http.Request
- func (context *Context) GetResponseWriter() http.ResponseWriter
- func (context *Context) GetStatus() Status
- func (context *Context) GetURL() *url.URL
- func (context *Context) GetURLParam(key string) string
- func (context *Context) InternalError(err error, message string, values ...interface{}) Status
- func (context *Context) JSON(code int, response interface{}) Status
- func (context *Context) NotFound() Status
- func (context *Context) OK() Status
- func (context *Context) Redirect(location string) Status
- func (context *Context) Render(name string) Status
- func (context *Context) Set(name string, value interface{}) *Context
- func (context *Context) SetResponseWriter(writer http.ResponseWriter)
- func (context *Context) SetStatus(status Status)
- func (context *Context) Write(body []byte) (int, error)
- type ContextKey
- type Handler
- type Status
- type Web
- func (web *Web) Group() *Web
- func (web *Web) LoadTemplates(directory string, funcs template.FuncMap) error
- func (web *Web) RedirectSlashes(exclude ...string) func(http.Handler) http.Handler
- func (web *Web) ServeDirectory(dir string, prefix string) http.HandlerFunc
- func (web *Web) ServeFunc(handler Handler) http.HandlerFunc
- func (web *Web) ServeResources(prefix string) http.HandlerFunc
- func (web *Web) ServeTemplate(name string) http.HandlerFunc
- func (web *Web) ServeTemplateWithData(name string, data map[string]interface{}) http.HandlerFunc
- func (web *Web) SetResourcesDir(dir string) error
- func (web *Web) Static(path string)
- func (web *Web) Use(middleware func(Handler) Handler)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { *karma.Context // contains filtered or unexported fields }
func NewContext ¶
func (*Context) BadRequest ¶
func (*Context) GetBody ¶
func (context *Context) GetBody() io.ReadCloser
func (*Context) GetQueryParam ¶
func (*Context) GetRequest ¶
func (*Context) GetResponseWriter ¶
func (context *Context) GetResponseWriter() http.ResponseWriter
func (*Context) GetURLParam ¶
func (*Context) InternalError ¶
func (*Context) SetResponseWriter ¶
func (context *Context) SetResponseWriter(writer http.ResponseWriter)
type ContextKey ¶
type ContextKey string
type Web ¶
func (*Web) LoadTemplates ¶
func (*Web) RedirectSlashes ¶
func (*Web) ServeDirectory ¶
func (web *Web) ServeDirectory(dir string, prefix string) http.HandlerFunc
func (*Web) ServeResources ¶
func (web *Web) ServeResources(prefix string) http.HandlerFunc
func (*Web) ServeTemplate ¶
func (web *Web) ServeTemplate(name string) http.HandlerFunc
func (*Web) ServeTemplateWithData ¶
func (web *Web) ServeTemplateWithData( name string, data map[string]interface{}, ) http.HandlerFunc
func (*Web) SetResourcesDir ¶
Click to show internal directories.
Click to hide internal directories.