routes

package
v0.0.0-...-12587cc Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2018 License: GPL-3.0 Imports: 25 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ErrDB               = "database_error"
	ErrUnexpected       = "unexpected_error"
	ErrWrongCredentials = "wrong_credentials_error"
	ErrNotConfirmed     = "user_not_confirmed"
	ErrUnequalPasswords = "passwords_unequal"
	ErrUserExists       = "user_exists"
	ErrMail             = "mail_error"
	ErrWrongGrade       = "wrong_grade_error"
	ErrIllegalInput     = "illegal_input_error"
	ErrFS               = "filesystem_error"
	ErrIllegalDate      = "illegal_date_error"
	ErrNotReady         = "server_not_ready_error"
	ErrNoAssets         = "no_assets_error"
	ErrUserNotFound     = "user_not_found_error"
	ErrRelationExists   = "relation_already_exists_error"
	ErrNoStudent        = "this_is_a_teacher_error"
	ErrInvalidCaptcha   = "invalid_captcha_error"
	ErrAdventNotOver    = "advent_not_over_error"
)

errors

View Source
const (
	MessLoggedIn        = "login_success"
	MessLoggedOut       = "logged_out"
	MessConfirmMailSent = "confirm_mail_sent"
	MessRestoreMailSent = "restore_mail_sent"
	MessChangedPassword = "password_changed"
	MessUserAssigned    = "user_assigned"
	MessUserConfirmed   = "user_confirmed"
	MessUserUnconfirmed = "user_unconfirmed"
	MessUserRemoved     = "user_removed"
)

messages

Variables

This section is empty.

Functions

func About

func About(ctx *macaron.Context, dStorer *storage.DocumentStorer, log *log.Logger)

About handles the route "/about"

func Account

func Account(ctx *macaron.Context, log *log.Logger, sess session.Store, rStorer *storage.RelationStorer, uStorer *storage.UserStorer)

Account handles the route "/account"

func Calendar

func Calendar(ctx *macaron.Context, log *log.Logger, sess session.Store)

Calendar handles the route "/calendar"

func Certificate

func Certificate(ctx *macaron.Context, sess session.Store, log *log.Logger)

Certificate handles the route "/certificate"

func Confirm

func Confirm(ctx *macaron.Context, uStorer *storage.UserStorer, sess session.Store)

Confirm handles the route "/confirm". The route is used by the confirmation link sent via mail.

func Current

func Current(ctx *macaron.Context, log *log.Logger)

Current handles the route "/day". It is a shortcut for "/day/[current_day]"

func Day

func Day(ctx *macaron.Context, log *log.Logger, dStorer *storage.DocumentStorer, sess session.Store, uStorer *storage.UserStorer)

Day handles the routes "/day/[some_day]"

func Home

func Home(ctx *macaron.Context, sess session.Store)

Home handles the route "/"

func Login

func Login(ctx *macaron.Context, log *log.Logger, uStorer *storage.UserStorer, sess session.Store)

Login handles the route "/login"

func Logout

func Logout(ctx *macaron.Context, uStorer *storage.UserStorer, sess session.Store)

Logout handles the route "/logout"

func Overview

func Overview(ctx *macaron.Context, log *log.Logger, dStorer *storage.DocumentStorer)

Overview handles the route "/overview"

func Protect

func Protect(ctx *macaron.Context, sess session.Store)

Protect ensures the routes "/logout", "/account", "/certificate", "/calendar" and "/day" can only be accessed when logged in

func PublicReady

func PublicReady(ctx *macaron.Context, dStorer *storage.DocumentStorer)

PublicReady ensures the routes "/calendar" and "/day" can only be accessed, when all required documents are available

func Register

func Register(ctx *macaron.Context, cpt *captcha.Captcha, log *log.Logger, uStorer *storage.UserStorer, sess session.Store)

Register handles the route "/register"

func RequireAdmin

func RequireAdmin(ctx *macaron.Context, sess session.Store)

RequireAdmin ensures the routes "/upload" and "/overview" can only be accessed by the admin

func Restore

func Restore(ctx *macaron.Context, log *log.Logger, uStorer *storage.UserStorer)

Restore handles the route "/restore"

func ToS

func ToS(ctx *macaron.Context, dStorer *storage.DocumentStorer, log *log.Logger)

ToS handles the route "/tos"

func Upload

func Upload(ctx *macaron.Context, log *log.Logger, dStorer *storage.DocumentStorer)

Upload handles the route "/upload"

Types

type Name

type Name string

Name is a workaround for storing the document's name for use in parseUrls

Jump to

Keyboard shortcuts

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