Documentation ¶
Index ¶
- Variables
- func App() *buffalo.App
- func AuthCallback(c buffalo.Context) error
- func AuthDestroy(c buffalo.Context) error
- func Authorize(next buffalo.Handler) buffalo.Handler
- func DashboardHandler(c buffalo.Context) error
- func DashboardOtherTopsHandler(c buffalo.Context) error
- func ListUserActivitiesHandler(c buffalo.Context) error
- func ListUsersHandler(c buffalo.Context) error
- func SecondsToHuman(duration int) string
- func SetCurrentUser(next buffalo.Handler) buffalo.Handler
- func ShowUsersHandler(c buffalo.Context) error
- func SyncAllActivitiesHandler(c buffalo.Context) error
- func SyncLastActivitiesHandler(c buffalo.Context) error
- func SyncUserAllActivitiesHandler(c buffalo.Context) error
- func SyncUserLatestActivitiesHandler(c buffalo.Context) error
- func WeeklyCountStatsHandler(c buffalo.Context) error
- func WeeklyCumulativeCountStatsHandler(c buffalo.Context) error
- func WeeklyCumulativeDistanceStatsHandler(c buffalo.Context) error
- func WeeklyDistanceStatsHandler(c buffalo.Context) error
- type ActivitiesResource
- func (v ActivitiesResource) Create(c buffalo.Context) error
- func (v ActivitiesResource) Destroy(c buffalo.Context) error
- func (v ActivitiesResource) Edit(c buffalo.Context) error
- func (v ActivitiesResource) List(c buffalo.Context) error
- func (v ActivitiesResource) New(c buffalo.Context) error
- func (v ActivitiesResource) Show(c buffalo.Context) error
- func (v ActivitiesResource) Update(c buffalo.Context) error
Constants ¶
This section is empty.
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".
var T *i18n.Translator
T - Translator for handling all your i18n needs.
Functions ¶
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 handles callback from provider
func AuthDestroy ¶
AuthDestroy will close and clear the login session
func DashboardHandler ¶
DashboardHandler shows a dashboard
func DashboardOtherTopsHandler ¶
DashboardOtherTopsHandler returns simple html (expected to be requested by js)
func ListUserActivitiesHandler ¶
ListUserActivitiesHandler will list all activities (does NOT call the provider)
func ListUsersHandler ¶
ListUsersHandler gets all Users. This function is mapped to the path GET /users
func SecondsToHuman ¶
SecondsToHuman converts minutes to human duration string (1d 7h 32m )
func SetCurrentUser ¶
SetCurrentUser will set a current_user_id on the context session
func ShowUsersHandler ¶
ShowUsersHandler gets the data for one User. This function is mapped to the path GET /users/{user_id}
func SyncAllActivitiesHandler ¶
SyncAllActivitiesHandler will import all users' all activities from the provider and populate the database
func SyncLastActivitiesHandler ¶
SyncLastActivitiesHandler will import all users' latest activities from the provider and populate the database
func SyncUserAllActivitiesHandler ¶
SyncUserAllActivitiesHandler will import user's all activities from the provider and populate the database
func SyncUserLatestActivitiesHandler ¶
SyncUserLatestActivitiesHandler will import user's latest activities from the provider and populate the database
func WeeklyCountStatsHandler ¶
WeeklyCountStatsHandler shows a weekly stats by user
func WeeklyCumulativeCountStatsHandler ¶
WeeklyCumulativeCountStatsHandler shows a weekly stats by user
func WeeklyCumulativeDistanceStatsHandler ¶
WeeklyCumulativeDistanceStatsHandler shows a weekly stats by user
func WeeklyDistanceStatsHandler ¶
WeeklyDistanceStatsHandler shows a weekly stats by user
Types ¶
type ActivitiesResource ¶
ActivitiesResource is the resource for the Activity model
func (ActivitiesResource) Create ¶
func (v ActivitiesResource) Create(c buffalo.Context) error
Create adds a Activity to the DB. This function is mapped to the path POST /activities
func (ActivitiesResource) Destroy ¶
func (v ActivitiesResource) Destroy(c buffalo.Context) error
Destroy deletes a Activity from the DB. This function is mapped to the path DELETE /activities/{activity_id}
func (ActivitiesResource) Edit ¶
func (v ActivitiesResource) Edit(c buffalo.Context) error
Edit renders a edit form for a Activity. This function is mapped to the path GET /activities/{activity_id}/edit
func (ActivitiesResource) List ¶
func (v ActivitiesResource) List(c buffalo.Context) error
List gets all Activities. This function is mapped to the path GET /activities
func (ActivitiesResource) New ¶
func (v ActivitiesResource) New(c buffalo.Context) error
New renders the form for creating a new Activity. This function is mapped to the path GET /activities/new