Documentation ¶
Index ¶
- Constants
- Variables
- func AdminAuth(next buffalo.Handler) buffalo.Handler
- func AdminUserGet(c buffalo.Context) error
- func App() *buffalo.App
- func AuthCallback(c buffalo.Context) error
- func AuthDestroy(c buffalo.Context) error
- func AuthHome(c buffalo.Context) error
- func Authorize(next buffalo.Handler) buffalo.Handler
- func BanUserGet(c buffalo.Context) error
- func CategoriesCreateGet(c buffalo.Context) error
- func CategoriesCreateOrEditPost(c buffalo.Context) error
- func CategoriesIndex(c buffalo.Context) error
- func ControlPanel(c buffalo.Context) error
- func ControlPanelHandler(next buffalo.Handler) buffalo.Handler
- func CreateEditForum(c buffalo.Context) error
- func CursoEvaluationCreateGet(c buffalo.Context) error
- func CursoEvaluationCreatePost(c buffalo.Context) error
- func CursoEvaluationDelete(c buffalo.Context) error
- func CursoEvaluationEditGet(c buffalo.Context) error
- func CursoEvaluationEditPost(c buffalo.Context) error
- func CursoEvaluationGet(c buffalo.Context) error
- func DeletePythonUploads(c buffalo.Context) error
- func DeleteReply(c buffalo.Context) error
- func DisplayName(u interface{}) string
- func EditForumPost(c buffalo.Context) error
- func Encode(msg []rune, alphabet string) string
- func EvaluationIndex(c buffalo.Context) error
- func HomeHandler(c buffalo.Context) error
- func InterpretPost(c buffalo.Context) error
- func NormalizeUserGet(c buffalo.Context) error
- func ReplyGet(c buffalo.Context) error
- func ReplyPost(c buffalo.Context) error
- func SafeList(next buffalo.Handler) buffalo.Handler
- func SafeListGet(c buffalo.Context) error
- func SafeListPost(c buffalo.Context) error
- func Search(c buffalo.Context) error
- func SetCurrentCategory(next buffalo.Handler) buffalo.Handler
- func SetCurrentForum(next buffalo.Handler) buffalo.Handler
- func SetCurrentReply(next buffalo.Handler) buffalo.Handler
- func SetCurrentTopic(next buffalo.Handler) buffalo.Handler
- func SetCurrentUser(next buffalo.Handler) buffalo.Handler
- func SiteStruct(next buffalo.Handler) buffalo.Handler
- func SubmissionCreateGet(c buffalo.Context) error
- func SubmissionsIndex(c buffalo.Context) error
- func ToBase(N *big.Int, alphabet string) string
- func ToNum(R []rune, alphabet string) *big.Int
- func TopicArchivePost(c buffalo.Context) error
- func TopicCreateGet(c buffalo.Context) error
- func TopicCreatePost(c buffalo.Context) error
- func TopicDelete(c buffalo.Context) error
- func TopicEditGet(c buffalo.Context) error
- func TopicEditPost(c buffalo.Context) error
- func TopicGet(c buffalo.Context) error
- func TopicSearch(c buffalo.Context) error
- func TopicUnvote(c buffalo.Context) error
- func TopicVote(c buffalo.Context) error
- func UserSettingsGet(c buffalo.Context) error
- func UserSettingsPost(c buffalo.Context) error
- func UsersSettingsRemoveTopicSubscription(c buffalo.Context) error
- func UsersViewAllGet(c buffalo.Context) error
Constants ¶
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 ¶
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
var T *i18n.Translator
T translator for context. use by calling T.Translate(ctx, "id")
Functions ¶
func AdminAuth ¶
AdminAuth This authorization is for server maintenance/management only authorizes where user has role=='admin'
func AdminUserGet ¶
AdminUserGet handles the event when an admin is created by another admin
func 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 ¶
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 ¶
AuthDestroy logout process. kills cookies leaving user unable to Authorize without logging in again
func Authorize ¶
Authorize Backbone of the authorization process. This should run before displaying any internal page and kick unauthorized users back to homepage
func CategoriesCreateGet ¶
CategoriesCreateGet default implementation.
func CategoriesCreateOrEditPost ¶
CategoriesCreateOrEditPost default implementation.
func CategoriesIndex ¶
CategoriesIndex default implementation.
func ControlPanel ¶
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
ControlPanelHandler handles POSTs from controlpanel forms. It requests an auth key and if it fails to validate it errors
func CreateEditForum ¶
CreateEditForum renders forum creation page
func CursoEvaluationCreateGet ¶
CursoEvaluationCreateGet renders evaluation creation page
func CursoEvaluationCreatePost ¶
CursoEvaluationCreatePost handles creation of evaluation
func CursoEvaluationDelete ¶
CursoEvaluationDelete handles deletion event of evaluation
func CursoEvaluationEditGet ¶
CursoEvaluationEditGet handles the rendering of the evaluation edit page
func CursoEvaluationEditPost ¶
CursoEvaluationEditPost handles the editing of an already existing evaluation
func CursoEvaluationGet ¶
CursoEvaluationGet handles rendering of an evaluation
func DeletePythonUploads ¶
DeletePythonUploads delete all python uploads in bbolt DB
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 ¶
EditForumPost handles forum editing event
func EvaluationIndex ¶
EvaluationIndex default implementation.
func HomeHandler ¶
HomeHandler is a default handler to serve up a home page. unused.
func InterpretPost ¶
InterpretPost receive POST request to submit and evaluate code
func NormalizeUserGet ¶
NormalizeUserGet event removing status from user and setting to empty string
func SafeList ¶
SafeList works kind of like authorize but does not verify user exists. includes helper function "hasBadWord" for sanitizing dirty language
func SafeListGet ¶
SafeListGet renders page with safelist. only admins can see
func SafeListPost ¶
SafeListPost handles event when more emails are added to safelist
func SetCurrentCategory ¶
SetCurrentCategory attempts to find a category and set context `category`
func SetCurrentForum ¶
SetCurrentForum attempts to find a forum definition in the db.
func SetCurrentReply ¶
SetCurrentReply don't know if this is used, probably not, right?
func SetCurrentTopic ¶
SetCurrentTopic sets 'topic' in context for easy use in html template
func SetCurrentUser ¶
SetCurrentUser This function is to provide Context with user information on `current_user`. If user is not logged in it does nothing.
func SiteStruct ¶
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 SubmissionsIndex ¶ added in v0.4.0
SubmissionsIndex default implementation.
func ToNum ¶
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 TopicCreateGet ¶
TopicCreateGet renders the topic creation page
func TopicCreatePost ¶
TopicCreatePost handles the topic creation event
func TopicDelete ¶
TopicDelete handles topic deletion event
func TopicEditGet ¶
TopicEditGet renders topic editing page. topic is already set by SetCurrentTopic
func TopicEditPost ¶
TopicEditPost handles topic editing event
func TopicSearch ¶
TopicSearch handles search-link click event from the search result page
func TopicUnvote ¶ added in v0.3.0
TopicUnvote remove vote from topic
func UserSettingsGet ¶
UserSettingsGet render page with user settings :)
func UserSettingsPost ¶
UserSettingsPost handles event when user changes setting by submitting setting form
func UsersSettingsRemoveTopicSubscription ¶
UsersSettingsRemoveTopicSubscription handles user clicking remove subscription button
func UsersViewAllGet ¶
UsersViewAllGet renders all users page (admins only)
Types ¶
This section is empty.