context

package
v0.2.38 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: MIT Imports: 10 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 {
	Request    *http.Request
	Writer     http.ResponseWriter
	Input      *input.Input
	Output     *output.Output
	Session    session.Sessioner
	RouterPath string

	Tmpl *tmpl.Tmpl
	// contains filtered or unexported fields
}

Context 上下文对象

func NewContext

func NewContext() *Context

NewContext 新建一个上下文

func (*Context) ContentType

func (c *Context) ContentType() string

ContentType

func (*Context) Cookie

func (c *Context) Cookie(name string) *lib.Data

Cookie 获得cookie

func (*Context) Domain added in v0.0.94

func (c *Context) Domain() string

Domain

func (*Context) DumpRequest added in v0.0.50

func (c *Context) DumpRequest() string

DumpRequest

func (*Context) FullPath

func (c *Context) FullPath() string

FullPath

func (*Context) GetHeader

func (c *Context) GetHeader(key string) string

GetHeader

func (*Context) Host

func (c *Context) Host() string

Host

func (*Context) HttpOrigin added in v0.0.12

func (c *Context) HttpOrigin() string

HttpOrigin

func (*Context) Init

func (c *Context) Init()

Init 初始化

func (*Context) Reset

func (c *Context) Reset()

重置

func (*Context) Router added in v0.0.31

func (c *Context) Router() string

Router

func (*Context) SetCookie

func (c *Context) SetCookie(name, value string)

SetCookie 设置cookie

func (*Context) SetCookieByExpire

func (c *Context) SetCookieByExpire(name, value string, expire int)

SetCookieByExpire

func (*Context) SetCookies

func (c *Context) SetCookies(name, value string, maxAge int, path, domain string, secure, httpOnly bool)

SetCookie 设置cookie

func (*Context) SetSameSite

func (c *Context) SetSameSite(sameSite http.SameSite)

SetSameSite

type HandlerFunc

type HandlerFunc func(*Context)

HandlerFunc 请求处理函数

Jump to

Keyboard shortcuts

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