actions

package
v0.0.0-...-b8c8894 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2022 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

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".

T - Translator for handling all your i18n needs.

Functions

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 handles callback from provider

func AuthDestroy

func AuthDestroy(c buffalo.Context) error

AuthDestroy will close and clear the login session

func Authorize

func Authorize(next buffalo.Handler) buffalo.Handler

Authorize will enforce a logged in user (if current_user_id in Context.Session())

func DashboardHandler

func DashboardHandler(c buffalo.Context) error

DashboardHandler shows a dashboard

func DashboardOtherTopsHandler

func DashboardOtherTopsHandler(c buffalo.Context) error

DashboardOtherTopsHandler returns simple html (expected to be requested by js)

func ListUserActivitiesHandler

func ListUserActivitiesHandler(c buffalo.Context) error

ListUserActivitiesHandler will list all activities (does NOT call the provider)

func ListUsersHandler

func ListUsersHandler(c buffalo.Context) error

ListUsersHandler gets all Users. This function is mapped to the path GET /users

func SecondsToHuman

func SecondsToHuman(duration int) string

SecondsToHuman converts minutes to human duration string (1d 7h 32m )

func SetCurrentUser

func SetCurrentUser(next buffalo.Handler) buffalo.Handler

SetCurrentUser will set a current_user_id on the context session

func ShowUsersHandler

func ShowUsersHandler(c buffalo.Context) error

ShowUsersHandler gets the data for one User. This function is mapped to the path GET /users/{user_id}

func SyncAllActivitiesHandler

func SyncAllActivitiesHandler(c buffalo.Context) error

SyncAllActivitiesHandler will import all users' all activities from the provider and populate the database

func SyncLastActivitiesHandler

func SyncLastActivitiesHandler(c buffalo.Context) error

SyncLastActivitiesHandler will import all users' latest activities from the provider and populate the database

func SyncUserAllActivitiesHandler

func SyncUserAllActivitiesHandler(c buffalo.Context) error

SyncUserAllActivitiesHandler will import user's all activities from the provider and populate the database

func SyncUserLatestActivitiesHandler

func SyncUserLatestActivitiesHandler(c buffalo.Context) error

SyncUserLatestActivitiesHandler will import user's latest activities from the provider and populate the database

func WeeklyCountStatsHandler

func WeeklyCountStatsHandler(c buffalo.Context) error

WeeklyCountStatsHandler shows a weekly stats by user

func WeeklyCumulativeCountStatsHandler

func WeeklyCumulativeCountStatsHandler(c buffalo.Context) error

WeeklyCumulativeCountStatsHandler shows a weekly stats by user

func WeeklyCumulativeDistanceStatsHandler

func WeeklyCumulativeDistanceStatsHandler(c buffalo.Context) error

WeeklyCumulativeDistanceStatsHandler shows a weekly stats by user

func WeeklyDistanceStatsHandler

func WeeklyDistanceStatsHandler(c buffalo.Context) error

WeeklyDistanceStatsHandler shows a weekly stats by user

Types

type ActivitiesResource

type ActivitiesResource struct {
	buffalo.Resource
}

ActivitiesResource is the resource for the Activity model

func (ActivitiesResource) Create

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

Edit renders a edit form for a Activity. This function is mapped to the path GET /activities/{activity_id}/edit

func (ActivitiesResource) List

List gets all Activities. This function is mapped to the path GET /activities

func (ActivitiesResource) New

New renders the form for creating a new Activity. This function is mapped to the path GET /activities/new

func (ActivitiesResource) Show

Show gets the data for one Activity. This function is mapped to the path GET /activities/{activity_id}

func (ActivitiesResource) Update

Update changes a Activity in the DB. This function is mapped to the path PUT /activities/{activity_id}

Jump to

Keyboard shortcuts

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