utils

package
v0.0.0-...-bf4029a Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2018 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckLogin

func CheckLogin(username string, password string) error

Check login returns an error if the user could not log in

func GetAdmins

func GetAdmins() []int

Returns a list of all admins in database

func GetCurrentUser

func GetCurrentUser(r *http.Request) interface{}

GetCurrentUser returns the current user

func GetDB

func GetDB() *gorm.DB

GetDB returns a connection to the database

func GetStore

func GetStore() *sessions.CookieStore

GetStore returns the current cookiestore

func HandleAccess

func HandleAccess(r *http.Request) bool

HandleAccess returns true if user is authorized to access

func Logout

func Logout(w http.ResponseWriter, r *http.Request)

Handle logging the user out

func Noescape

func Noescape(str string) template.HTML

Noescape unescapes HTML passed to templates from trusted sources

Types

This section is empty.

Jump to

Keyboard shortcuts

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