context

package
v0.0.0-...-6feaff8 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SessionIDIsAuthenticated = "_isAuthenticated"
)

Variables

This section is empty.

Functions

func Contexter

func Contexter(gormDB *gorm.DB) flamego.Handler

Contexter initializes a classic context for a request.

func ReadIDFunc

func ReadIDFunc(r *http.Request) string

func WriteIDFunc

func WriteIDFunc(w http.ResponseWriter, r *http.Request, sid string, created bool)

Types

type Context

type Context struct {
	flamego.Context
	IsAuthenticated bool
}

Context represents context of a request.

func (*Context) Error

func (c *Context) Error(statusCode int, message string, v ...interface{}) error

func (*Context) ServerError

func (c *Context) ServerError() error

func (*Context) Status

func (c *Context) Status(statusCode int)

func (*Context) Success

func (c *Context) Success(data ...interface{}) error

Jump to

Keyboard shortcuts

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