actions

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: MIT Imports: 51 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Padding   = '='
	AbcASCII  = "" /* 267-byte string literal not displayed */
	Abc64     = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
	Abc64safe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
	Abc10     = "0123456789"
	AbcABC    = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	Abcabc    = "abcdefghijklmnopqrstuvwxyz"
	AbcUID    = Abcabc + Abc10 + "-"
)

These are

Variables

View Source
var ENV = envy.Get("GO_ENV", "development")

ENV is used to help switch settings based on where the application is being run. Default is "development". GO_ENV = "production" for deployment

T translator for context. use by calling T.Translate(ctx, "id")

Functions

func AdminAuth

func AdminAuth(next buffalo.Handler) buffalo.Handler

AdminAuth This authorization is for server maintenance/management only authorizes where user has role=='admin'

func AdminUserGet

func AdminUserGet(c buffalo.Context) error

AdminUserGet handles the event when an admin is created by another admin

func App

func App() *buffalo.App

App is where all routes and middleware for buffalo should be defined. This is the nerve center of your application.

Routing, middleware, groups, etc... are declared TOP -> DOWN. This means if you add a middleware to `app` *after* declaring a group, that group will NOT have that new middleware. The same is true of resource declarations as well.

It also means that routes are checked in the order they are declared. `ServeFiles` is a CATCH-ALL route, so it should always be placed last in the route declarations, as it will prevent routes declared after it to never be called.

func AuthCallback

func AuthCallback(c buffalo.Context) error

AuthCallback When user log into provider they are redirected to this function which creates the session id in user cookie jar. The user then can then be authorized successfully through Authorize function The user is also added to DB if they don't exist here

func AuthDestroy

func AuthDestroy(c buffalo.Context) error

AuthDestroy logout process. kills cookies leaving user unable to Authorize without logging in again

func AuthHome

func AuthHome(c buffalo.Context) error

AuthHome renders page with all provider options

func Authorize

func Authorize(next buffalo.Handler) buffalo.Handler

Authorize Backbone of the authorization process. This should run before displaying any internal page and kick unauthorized users back to homepage

func BanUserGet

func BanUserGet(c buffalo.Context) error

BanUserGet ban user event by admin

func CategoriesCreateGet

func CategoriesCreateGet(c buffalo.Context) error

CategoriesCreateGet default implementation.

func CategoriesCreateOrEditPost

func CategoriesCreateOrEditPost(c buffalo.Context) error

CategoriesCreateOrEditPost default implementation.

func CategoriesIndex

func CategoriesIndex(c buffalo.Context) error

CategoriesIndex default implementation.

func ControlPanel

func ControlPanel(c buffalo.Context) error

ControlPanel renders page for controlling server backend stuff. html contains python deletion at the time of writing this

func ControlPanelHandler added in v0.3.0

func ControlPanelHandler(next buffalo.Handler) buffalo.Handler

ControlPanelHandler handles POSTs from controlpanel forms. It requests an auth key and if it fails to validate it errors

func CreateEditForum

func CreateEditForum(c buffalo.Context) error

CreateEditForum renders forum creation page

func CursoEvaluationCreateGet

func CursoEvaluationCreateGet(c buffalo.Context) error

CursoEvaluationCreateGet renders evaluation creation page

func CursoEvaluationCreatePost

func CursoEvaluationCreatePost(c buffalo.Context) error

CursoEvaluationCreatePost handles creation of evaluation

func CursoEvaluationDelete

func CursoEvaluationDelete(c buffalo.Context) error

CursoEvaluationDelete handles deletion event of evaluation

func CursoEvaluationEditGet

func CursoEvaluationEditGet(c buffalo.Context) error

CursoEvaluationEditGet handles the rendering of the evaluation edit page

func CursoEvaluationEditPost

func CursoEvaluationEditPost(c buffalo.Context) error

CursoEvaluationEditPost handles the editing of an already existing evaluation

func CursoEvaluationGet

func CursoEvaluationGet(c buffalo.Context) error

CursoEvaluationGet handles rendering of an evaluation

func DeletePythonUploads

func DeletePythonUploads(c buffalo.Context) error

DeletePythonUploads delete all python uploads in bbolt DB

func DeleteReply

func DeleteReply(c buffalo.Context) error

DeleteReply handles reply delete event

func DisplayName

func DisplayName(u interface{}) string

DisplayName user's Nick/alias or name is shown. preference for showing user Nick for privacy purposes this should be a method in models/user.go so it can be called directly without having nil checks (TODO)

func EditForumPost

func EditForumPost(c buffalo.Context) error

EditForumPost handles forum editing event

func Encode

func Encode(msg []rune, alphabet string) string

Encode encodes rune message to given alphabet

func EvaluationIndex

func EvaluationIndex(c buffalo.Context) error

EvaluationIndex default implementation.

func HomeHandler

func HomeHandler(c buffalo.Context) error

HomeHandler is a default handler to serve up a home page. unused.

func InterpretPost

func InterpretPost(c buffalo.Context) error

InterpretPost receive POST request to submit and evaluate code

func NormalizeUserGet

func NormalizeUserGet(c buffalo.Context) error

NormalizeUserGet event removing status from user and setting to empty string

func ReplyGet

func ReplyGet(c buffalo.Context) error

ReplyGet creation page rendering

func ReplyPost

func ReplyPost(c buffalo.Context) error

ReplyPost handling of reply creation event

func SafeList

func SafeList(next buffalo.Handler) buffalo.Handler

SafeList works kind of like authorize but does not verify user exists. includes helper function "hasBadWord" for sanitizing dirty language

func SafeListGet

func SafeListGet(c buffalo.Context) error

SafeListGet renders page with safelist. only admins can see

func SafeListPost

func SafeListPost(c buffalo.Context) error

SafeListPost handles event when more emails are added to safelist

func Search(c buffalo.Context) error

Search handles and does heavylifting of search. renders search results page

func SetCurrentCategory

func SetCurrentCategory(next buffalo.Handler) buffalo.Handler

SetCurrentCategory attempts to find a category and set context `category`

func SetCurrentForum

func SetCurrentForum(next buffalo.Handler) buffalo.Handler

SetCurrentForum attempts to find a forum definition in the db.

func SetCurrentReply

func SetCurrentReply(next buffalo.Handler) buffalo.Handler

SetCurrentReply don't know if this is used, probably not, right?

func SetCurrentTopic

func SetCurrentTopic(next buffalo.Handler) buffalo.Handler

SetCurrentTopic sets 'topic' in context for easy use in html template

func SetCurrentUser

func SetCurrentUser(next buffalo.Handler) buffalo.Handler

SetCurrentUser This function is to provide Context with user information on `current_user`. If user is not logged in it does nothing.

func SiteStruct

func SiteStruct(next buffalo.Handler) buffalo.Handler

SiteStruct adds basic paths to context. is legacy code and should be removed in favour of using context functions such as forumPath()

func SubmissionCreateGet added in v0.4.0

func SubmissionCreateGet(c buffalo.Context) error

func SubmissionsIndex added in v0.4.0

func SubmissionsIndex(c buffalo.Context) error

SubmissionsIndex default implementation.

func ToBase

func ToBase(N *big.Int, alphabet string) string

ToBase changes base of a number to len(alphabet).

func ToNum

func ToNum(R []rune, alphabet string) *big.Int

ToNum changes representation of a number in base len(alphabet) to it's math/big Int representation.

func TopicArchivePost added in v0.4.0

func TopicArchivePost(c buffalo.Context) error

func TopicCreateGet

func TopicCreateGet(c buffalo.Context) error

TopicCreateGet renders the topic creation page

func TopicCreatePost

func TopicCreatePost(c buffalo.Context) error

TopicCreatePost handles the topic creation event

func TopicDelete

func TopicDelete(c buffalo.Context) error

TopicDelete handles topic deletion event

func TopicEditGet

func TopicEditGet(c buffalo.Context) error

TopicEditGet renders topic editing page. topic is already set by SetCurrentTopic

func TopicEditPost

func TopicEditPost(c buffalo.Context) error

TopicEditPost handles topic editing event

func TopicGet

func TopicGet(c buffalo.Context) error

TopicGet render a topic. basis of the forum

func TopicSearch

func TopicSearch(c buffalo.Context) error

TopicSearch handles search-link click event from the search result page

func TopicUnvote added in v0.3.0

func TopicUnvote(c buffalo.Context) error

TopicUnvote remove vote from topic

func TopicVote added in v0.3.0

func TopicVote(c buffalo.Context) error

TopicVote Handles voting event. adds vote to topic

func UserSettingsGet

func UserSettingsGet(c buffalo.Context) error

UserSettingsGet render page with user settings :)

func UserSettingsPost

func UserSettingsPost(c buffalo.Context) error

UserSettingsPost handles event when user changes setting by submitting setting form

func UsersSettingsRemoveTopicSubscription

func UsersSettingsRemoveTopicSubscription(c buffalo.Context) error

UsersSettingsRemoveTopicSubscription handles user clicking remove subscription button

func UsersViewAllGet

func UsersViewAllGet(c buffalo.Context) error

UsersViewAllGet renders all users page (admins only)

Types

This section is empty.

Jump to

Keyboard shortcuts

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