globals

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const CurrentUserKey = "globals.current_user"

Variables

This section is empty.

Functions

func CurrentUser

func CurrentUser(c *fiber.Ctx) *db.User

CurrentUser returns the current user from the session.

func IsCurrentUser

func IsCurrentUser(c *fiber.Ctx, userID int64) bool

IsCurrentUser returns whether user is the current user.

Types

type Values

type Values struct {
	Flash        *flash.Message
	User         *db.User
	CurrentRoute string
}

func Get

func Get(c *fiber.Ctx) *Values

Get returns the encapsulated globals to be referenced from templates.

Jump to

Keyboard shortcuts

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