controllers

package
v0.0.0-...-f080756 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2018 License: MIT Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CSRFExemptPrefixes = []string{}

CSRFExemptPrefixes - list of endpoints that does not require csrf protction

Functions

func AuthHandler

func AuthHandler(handler http.Handler) http.HandlerFunc

AuthHandler - checks if user is logged in

func CSRFExceptions

func CSRFExceptions(handler http.Handler) http.HandlerFunc

CSRFExceptions - exempts ajax calls from csrf tokens

func GetContext

func GetContext(handler http.Handler) http.HandlerFunc

GetContext wraps each request in a function which fills in the context for a given request. This includes setting the User and Session keys and values as necessary for use in later functions.

func LoginHandler

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

LoginHandler - handles the POST reques to /login

func LoginPageHandler

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

LoginPageHandler - GET response to login page

func LogoutHandler

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

LogoutHandler - handles logout requests

func RootHandler

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

RootHandler - http handler for handling / path

func UserDetails

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

UserDetails - returns user name who is logged in

func WSHandler

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

WSHandler - Websocket handler

Types

This section is empty.

Jump to

Keyboard shortcuts

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