hono

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewJSResponse

func NewJSResponse(body io.ReadCloser, statusCode int, headers http.Header) js.Value

func NewJSResponseWithBase

func NewJSResponseWithBase(body io.ReadCloser, baseRespObj js.Value) js.Value

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 (c *Context) RawResponse() js.Value

func (*Context) Request

func (c *Context) Request() *http.Request

func (*Context) ResponseBody

func (c *Context) ResponseBody() io.ReadCloser

func (*Context) SetBody

func (c *Context) SetBody(body io.ReadCloser)

func (*Context) SetHeader

func (c *Context) SetHeader(key, value string)

func (*Context) SetResponse

func (c *Context) SetResponse(respObj js.Value)

func (*Context) SetStatus

func (c *Context) SetStatus(statusCode int)

type Middleware

type Middleware func(c *Context, next func())

func ChainMiddlewares

func ChainMiddlewares(middlewares ...Middleware) Middleware

Jump to

Keyboard shortcuts

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