middleware

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckHashPassword

func CheckHashPassword(hash, password string) bool

CheckHashPassword: hash for password to bool

func ClearSession

func ClearSession(c echo.Context) (err error)

ClearSession: delete session from User

func GetAdmin

func GetAdmin(c echo.Context) (session_gorilla *sessions.Session, err error)

GetAdmin: allows access only to authenticated administrators

func GetAuth

func GetAuth(c echo.Context) (session_gorilla *sessions.Session, err error)

GetAuth: get session to authenticated

func GetFlash

func GetFlash(c echo.Context, name string) (flashes []string)

GetFlash: get session for flash messages

func GetFlashError

func GetFlashError(c echo.Context) []string

GetFlashError: get session for flash message: []error

func GetFlashSuccess

func GetFlashSuccess(c echo.Context) []string

GetFlashSuccess: get session for flash messages: []success

func IsAdmin

func IsAdmin(is_auth_type interface{}) bool

IsAdmin: allows access only to authenticated administrators

func IsUser

func IsUser(is_auth_type interface{}) bool

IsUser: allows access only to authenticated users

func PasswordHash

func PasswordHash(password string) (string, error)

PasswordHash: hash for password to string

func RefreshSession

func RefreshSession(user models.User, c echo.Context) (session_gorilla *sessions.Session, err error)

RefreshSession: refresh session from User

func SetFlash

func SetFlash(c echo.Context, name, value string)

SetFlash: set session for flash message

func SetFlashError

func SetFlashError(c echo.Context, error string)

SetFlashError: get session for flash message: error

func SetFlashSuccess

func SetFlashSuccess(c echo.Context, success string)

SetFlashSuccess: set session for flash message: success

func SetSession

func SetSession(user models.User, c echo.Context) (session_gorilla *sessions.Session, err error)

SetSession: set session from User

Types

This section is empty.

Jump to

Keyboard shortcuts

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