context

package
v0.0.0-...-3511abf Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DetContext

type DetContext struct {
	echo.Context
}

DetContext is a wrapper around echo.Context so that some convenience functions that depend on context can be made accessible to handlers.

func (*DetContext) GetUsername

func (c *DetContext) GetUsername() string

GetUsername returns the username for the relevant echo request context, or unknown.

func (*DetContext) MustGetUser

func (c *DetContext) MustGetUser() model.User

MustGetUser returns the user for the relevant echo request context. Panics if the user has not been set, so this method should only be used inside handlers that _require_ authentication.

func (*DetContext) MustGetUserSession

func (c *DetContext) MustGetUserSession() model.UserSession

MustGetUserSession returns the user session for the relevant echo request context. Panics if the user has not been set, so this method should only be used inside handlers that _require_ authentication.

func (*DetContext) SetUser

func (c *DetContext) SetUser(user model.User)

SetUser sets the user for an echo request context.

func (*DetContext) SetUserSession

func (c *DetContext) SetUserSession(session model.UserSession)

SetUserSession sets session information for an echo request context.

Jump to

Keyboard shortcuts

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