routes

package
Version: v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2020 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Overview

Neat Note. A notes sharing platform for university students. Copyright (C) 2020 Humaid AlQassimi

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Neat Note. A notes sharing platform for university students. Copyright (C) 2020 Humaid AlQassimi

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Neat Note. A notes sharing platform for university students. Copyright (C) 2020 Humaid AlQassimi

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Neat Note. A notes sharing platform for university students. Copyright (C) 2020 Humaid AlQassimi

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Neat Note. A notes sharing platform for university students. Copyright (C) 2020 Humaid AlQassimi

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Neat Note. A notes sharing platform for university students. Copyright (C) 2020 Humaid AlQassimi

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Neat Note. A notes sharing platform for university students. Copyright (C) 2020 Humaid AlQassimi

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Index

Constants

View Source
const (
	// LoggedOut is when a user is logged out.
	LoggedOut = iota
	// Verification is when a user is in the verification process.
	Verification
	// LoggedIn is when the user is verified and logged in.
	LoggedIn
)

Variables

This section is empty.

Functions

func AdminAddCourseHandler

func AdminAddCourseHandler(ctx *macaron.Context, x csrf.CSRF, sess session.Store, f *session.Flash)

AdminAddCourseHandler response for adding a new course.

func AdminHandler added in v0.3.1

func AdminHandler(ctx *macaron.Context, x csrf.CSRF, sess session.Store, f *session.Flash)

AdminHandler response for the admin dashboard.

func AdminPostAddCourseHandler

func AdminPostAddCourseHandler(ctx *macaron.Context, sess session.Store, f *session.Flash)

AdminPostAddCourseHandler post response for adding a new course.

func AdminViewUserHandler added in v0.3.1

func AdminViewUserHandler(ctx *macaron.Context, x csrf.CSRF, sess session.Store, f *session.Flash)

AdminViewUserHandler response for viewing a user's information.

func CancelHandler

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

CancelHandler post response for canceling verification.

func ContextInit

func ContextInit() macaron.Handler

ContextInit is a middleware which initialises some global variables, and verifies the login status.

func CourseExists

func CourseExists(ctx *macaron.Context, sess session.Store, f *session.Flash)

CourseExists is a per-route middleware which checks if the course exists in the database, otherwise display an error.

func CourseHandler

func CourseHandler(ctx *macaron.Context, sess session.Store, f *session.Flash)

CourseHandler response for a course page.

func CourseUnlocked

func CourseUnlocked(ctx *macaron.Context, sess session.Store, f *session.Flash)

CourseUnlocked is a per-route middleware which checks if the course is unlocked, otherwise display an error.

func CreatePostHandler

func CreatePostHandler(ctx *macaron.Context, x csrf.CSRF, sess session.Store, f *session.Flash)

CreatePostHandler response for creating a new post.

func DeleteCommentHandler

func DeleteCommentHandler(ctx *macaron.Context, sess session.Store, f *session.Flash)

DeleteCommentHandler response for deleting a comment.

func DeletePostHandler

func DeletePostHandler(ctx *macaron.Context, sess session.Store, f *session.Flash)

DeletePostHandler response for deleting a post.

func EditCommentHandler

func EditCommentHandler(ctx *macaron.Context, x csrf.CSRF, sess session.Store, f *session.Flash)

EditCommentHandler response for a post page.

func EditPostHandler

func EditPostHandler(ctx *macaron.Context, x csrf.CSRF, sess session.Store, f *session.Flash)

EditPostHandler response for a post page.

func GuidelinesHandler

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

GuidelinesHandler response for the Guidelines page.

func HomepageHandler

func HomepageHandler(ctx *macaron.Context, sess session.Store, f *session.Flash)

HomepageHandler response for the home page.

func LitePostHandler added in v0.3.1

func LitePostHandler(ctx *macaron.Context, x csrf.CSRF, sess session.Store, f *session.Flash)

LitePostHandler response for a light post page.

func LoginHandler

func LoginHandler(ctx *macaron.Context, x csrf.CSRF, sess session.Store, f *session.Flash)

LoginHandler response for logging in page.

func LogoutHandler

func LogoutHandler(ctx *macaron.Context, sess session.Store, f *session.Flash)

LogoutHandler response for logging out.

func PostAdminHandler added in v0.3.1

func PostAdminHandler(ctx *macaron.Context, x csrf.CSRF, sess session.Store, f *session.Flash)

PostAdminHandler post response for admin dashboard.

func PostCommentPostHandler

func PostCommentPostHandler(ctx *macaron.Context, sess session.Store, f *session.Flash)

PostCommentPostHandler post response for posting a comment to a post.

func PostCreatePostHandler

func PostCreatePostHandler(ctx *macaron.Context, sess session.Store, f *session.Flash)

PostCreatePostHandler post response for creating a new post.

func PostDataHandler

func PostDataHandler(ctx *macaron.Context, sess session.Store, f *session.Flash)

PostDataHandler post response for requesting data (GDPR compliance).

func PostEditCommentHandler

func PostEditCommentHandler(ctx *macaron.Context, x csrf.CSRF, sess session.Store, f *session.Flash)

PostEditCommentHandler post response for editing a post.

func PostEditPostHandler

func PostEditPostHandler(ctx *macaron.Context, x csrf.CSRF, sess session.Store, f *session.Flash)

PostEditPostHandler post response for editing a post.

func PostExists

func PostExists(ctx *macaron.Context, sess session.Store, f *session.Flash)

PostExists is a per-route middleware which checks if the course and post exists in the database, otherwise display an error.

func PostLoginHandler

func PostLoginHandler(ctx *macaron.Context, sess session.Store, f *session.Flash)

PostLoginHandler post response for login page.

func PostPageHandler

func PostPageHandler(ctx *macaron.Context, x csrf.CSRF, sess session.Store, f *session.Flash)

PostPageHandler response for a post page.

func PostProfileHandler

func PostProfileHandler(ctx *macaron.Context, sess session.Store, f *session.Flash)

PostProfileHandler post response for the profile page.

func PostUnlocked

func PostUnlocked(ctx *macaron.Context, sess session.Store, f *session.Flash)

PostUnlocked is a per-route middleware which checks if the course and post is unlocked, otherwise display an error.

func PostVerifyHandler

func PostVerifyHandler(ctx *macaron.Context, sess session.Store, f *session.Flash)

PostVerifyHandler post reponse for verification.

func ProfileHandler

func ProfileHandler(ctx *macaron.Context, x csrf.CSRF, sess session.Store, f *session.Flash)

ProfileHandler response for the profile page.

func QnAHandler

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

QnAHandler response for the Questions and Answers page.

func RequireAdmin

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

RequireAdmin is a per-route middleware which checks if the user is an admin, otherwise display an error.

func RequireLogin

func RequireLogin(ctx *macaron.Context, sess session.Store, f *session.Flash)

RequireLogin is a per-route middleware which checks if the user is logged in, othwerise redirect to the login page and display an error.

func RevealPosterHandler

func RevealPosterHandler(ctx *macaron.Context, x csrf.CSRF, sess session.Store, f *session.Flash)

ReveaPosterHandler response for revealing the user.

func UpvotePostHandler

func UpvotePostHandler(ctx *macaron.Context, sess session.Store, f *session.Flash)

UpvotePostHandler post response for posting a comment to a post.

func VerifyHandler

func VerifyHandler(ctx *macaron.Context, x csrf.CSRF, sess session.Store, f *session.Flash)

VerifyHandler response for verification page.

Types

This section is empty.

Jump to

Keyboard shortcuts

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