context

package
v0.0.0-...-0bd2313 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exam

func Exam(ctx context.Context) *exam.Exam

func HTTPValuesContext

func HTTPValuesContext(ctx context.Context, hv *HttpValues) context.Context

func Question

func Question(ctx context.Context) *question.Question

func Release

func Release(c *Context)

func Session

func Session(ctx context.Context) *session.Session

func User

func User(ctx context.Context) *user.User

Types

type Context

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

func Acquire

func Acquire(rw http.ResponseWriter, r *http.Request) *Context

func (*Context) BindJson

func (ctx *Context) BindJson(dst interface{}) error

func (*Context) Context

func (ctx *Context) Context() context.Context

func (*Context) Cookie

func (ctx *Context) Cookie(name string) (string, error)

func (*Context) Created

func (ctx *Context) Created(location string, data interface{}) error

func (*Context) Exam

func (ctx *Context) Exam() *exam.Exam

func (*Context) IP

func (ctx *Context) IP() string

func (*Context) Json

func (ctx *Context) Json(status int, data interface{}) error

func (*Context) OK

func (ctx *Context) OK(data interface{}) error

func (*Context) Param

func (ctx *Context) Param(p string) string

func (*Context) PermanentRedirect

func (ctx *Context) PermanentRedirect(url string) error

func (*Context) Question

func (ctx *Context) Question() *question.Question

func (*Context) RemoveCookie

func (ctx *Context) RemoveCookie(name string)

func (*Context) Request

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

func (*Context) Response

func (ctx *Context) Response() http.ResponseWriter

func (*Context) SendStatus

func (ctx *Context) SendStatus(status int) error

func (*Context) Session

func (ctx *Context) Session() *session.Session

func (*Context) SetCookie

func (ctx *Context) SetCookie(name, value string, maxAge int, path, domain string, secure, httpOnly bool, sameSite http.SameSite)

func (*Context) SetSecureCookie

func (ctx *Context) SetSecureCookie(name, value string, maxAge int, path, domain string)

func (*Context) Signed

func (ctx *Context) Signed() bool

func (*Context) String

func (ctx *Context) String(status int, data string) error

func (*Context) TemporaryRedirect

func (ctx *Context) TemporaryRedirect(url string) error

func (*Context) User

func (ctx *Context) User() *user.User

func (*Context) WithExam

func (ctx *Context) WithExam(e *exam.Exam) *Context

func (*Context) WithQuestion

func (ctx *Context) WithQuestion(q *question.Question) *Context

func (*Context) WithSession

func (ctx *Context) WithSession(s *session.Session) *Context

func (*Context) WithUser

func (ctx *Context) WithUser(u *user.User) *Context

type HttpValues

type HttpValues struct {
	IP        string
	UserAgent string
}

func HTTPValues

func HTTPValues(ctx context.Context) *HttpValues

type Map

type Map map[string]interface{}

Jump to

Keyboard shortcuts

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