Documentation
¶
Index ¶
- func NewJSResponse(body io.ReadCloser, statusCode int, headers http.Header) js.Value
- func NewJSResponseWithBase(body io.ReadCloser, baseRespObj js.Value) js.Value
- func ServeMiddleware(middleware_ Middleware)
- type Context
- func (c *Context) RawResponse() js.Value
- func (c *Context) Request() *http.Request
- func (c *Context) ResponseBody() io.ReadCloser
- func (c *Context) SetBody(body io.ReadCloser)
- func (c *Context) SetHeader(key, value string)
- func (c *Context) SetResponse(respObj js.Value)
- func (c *Context) SetStatus(statusCode int)
- type Middleware
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewJSResponse ¶
func NewJSResponseWithBase ¶
func ServeMiddleware ¶
func ServeMiddleware(middleware_ Middleware)
ServeMiddleware sets the Task to be executed
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func (*Context) RawResponse ¶
func (*Context) ResponseBody ¶
func (c *Context) ResponseBody() io.ReadCloser
func (*Context) SetBody ¶
func (c *Context) SetBody(body io.ReadCloser)
func (*Context) SetResponse ¶
type Middleware ¶
type Middleware func(c *Context, next func())
func ChainMiddlewares ¶
func ChainMiddlewares(middlewares ...Middleware) Middleware
Click to show internal directories.
Click to hide internal directories.