context

package
v0.0.0-...-b667aad Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Req            *http.Request
	Resp           http.ResponseWriter
	RespStatusCode int
	RespData       []byte
	MatchedRoute   string
	PathParams     map[string]string

	TplEngine  template.TemplateEngine
	UserValues map[string]any
	// contains filtered or unexported fields
}

func (*Context) BindJson

func (c *Context) BindJson(val any) error

func (*Context) FormValue

func (c *Context) FormValue(key string) StringValue

func (*Context) PathValue

func (c *Context) PathValue(key string) StringValue

func (*Context) QueryValue

func (c *Context) QueryValue(key string) StringValue

func (*Context) Render

func (c *Context) Render(tpl string, data any) error

func (*Context) RespJSON

func (c *Context) RespJSON(code int, val any) error

func (*Context) RespJSONOK

func (c *Context) RespJSONOK(val any) error

func (*Context) SetCookie

func (c *Context) SetCookie(cookie *http.Cookie)

type StringValue

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

func (StringValue) ToInt64

func (s StringValue) ToInt64() (int64, error)

func (StringValue) ToString

func (s StringValue) ToString() (string, error)

Jump to

Keyboard shortcuts

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