context

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2025 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DataKeyStr dataKey = "data"

Variables

View Source
var ManifestEntries map[string]Asset

Functions

This section is empty.

Types

type Asset

type Asset struct {
	File string `json:"file"`
}

type Context

type Context struct {
	echo.Context

	User *db.User
	// contains filtered or unexported fields
}

func NewContext

func NewContext(c echo.Context, sessionPath string) *Context

func (*Context) AddFlash

func (ctx *Context) AddFlash(flashMessage string, flashType string)

func (*Context) DataMap

func (ctx *Context) DataMap() echo.Map

func (*Context) DeleteCsrfCookie

func (ctx *Context) DeleteCsrfCookie()

func (*Context) DeleteSession

func (ctx *Context) DeleteSession()

func (*Context) ErrorRes

func (ctx *Context) ErrorRes(code int, message string, err error) error

func (*Context) GetData

func (ctx *Context) GetData(key string) any

func (*Context) GetSession

func (ctx *Context) GetSession() *sessions.Session

func (*Context) Html

func (ctx *Context) Html(template string) error

func (*Context) HtmlWithCode

func (ctx *Context) HtmlWithCode(code int, template string) error

func (*Context) Json

func (ctx *Context) Json(data any) error

func (*Context) JsonWithCode

func (ctx *Context) JsonWithCode(code int, data any) error

func (*Context) NotFound

func (ctx *Context) NotFound(message string) error

func (*Context) PlainText

func (ctx *Context) PlainText(code int, message string) error

func (*Context) RedirectTo

func (ctx *Context) RedirectTo(location string) error

func (*Context) SaveSession

func (ctx *Context) SaveSession(sess *sessions.Session)

func (*Context) SetData

func (ctx *Context) SetData(key string, value any)

func (*Context) Tr

func (ctx *Context) Tr(key string, args ...any) string

func (*Context) TrH

func (ctx *Context) TrH(key string, args ...any) template.HTML

type Store

type Store struct {
	UserStore *sessions.FilesystemStore
	// contains filtered or unexported fields
}

func NewStore

func NewStore(sessionsPath string) *Store

Jump to

Keyboard shortcuts

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