actions

package
v0.0.0-...-1cfbb54 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2020 License: MIT Imports: 25 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 is a translator used for internationalization

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.

func AuthCallback

func AuthCallback(c buffalo.Context) error

AuthCallback returned after goth finishes user authentication saves new user and profile to database

func AuthDestroy

func AuthDestroy(c buffalo.Context) error

AuthDestroy implements logout functionality

func Authorize

func Authorize(next buffalo.Handler) buffalo.Handler

Authorize is a middleware which adds validation for authorized routes

func HomeHandler

func HomeHandler(c buffalo.Context) error

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

func LoginHandler

func LoginHandler(c buffalo.Context) error

LoginHandler is a default handler to serve up a home page.

func ProfileHandler

func ProfileHandler(c buffalo.Context) error

ProfileHandler is a default handler to serve up a profile page.

func ReactHandler

func ReactHandler(c buffalo.Context) error

ReactHandler is a default handler to serve up a home page. TODO

func SetCurrentUser

func SetCurrentUser(next buffalo.Handler) buffalo.Handler

SetCurrentUser is a middleware which adds current_user info to the incoming request

func UpdateProfileHandler

func UpdateProfileHandler(c buffalo.Context) error

UpdateProfileHandler is a default handler to serve up a profile page.

func UserDestroy

func UserDestroy(c buffalo.Context) error

UserDestroy deletes a User from the DB. This function is mapped to the path DELETE /users/{user_id}

Types

type ContactsResource

type ContactsResource struct {
	buffalo.Resource
}

ContactsResource is the resource for the Contact model

func (ContactsResource) Create

func (v ContactsResource) Create(c buffalo.Context) error

Create adds a Contact to the DB. This function is mapped to the path POST /contacts

func (ContactsResource) Destroy

func (v ContactsResource) Destroy(c buffalo.Context) error

Destroy deletes a Contact from the DB. This function is mapped to the path DELETE /contacts/{contact_id}

func (ContactsResource) Edit

Edit renders a edit form for a Contact. This function is mapped to the path GET /contacts/{contact_id}/edit

func (ContactsResource) List

List gets all Contacts. This function is mapped to the path GET /contacts

func (ContactsResource) New

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

func (ContactsResource) Show

Show gets the data for one Contact. This function is mapped to the path GET /contacts/{contact_id}

func (ContactsResource) Update

func (v ContactsResource) Update(c buffalo.Context) error

Update changes a Contact in the DB. This function is mapped to the path PUT /contacts/{contact_id}

type WidgetsResource

type WidgetsResource struct {
	buffalo.Resource
}

WidgetsResource is the resource for the Widget model

func (WidgetsResource) Create

func (v WidgetsResource) Create(c buffalo.Context) error

Create adds a Widget to the DB. This function is mapped to the path POST /widgets

func (WidgetsResource) Destroy

func (v WidgetsResource) Destroy(c buffalo.Context) error

Destroy deletes a Widget from the DB. This function is mapped to the path DELETE /widgets/{widget_id}

func (WidgetsResource) Edit

Edit renders a edit form for a Widget. This function is mapped to the path GET /widgets/{widget_id}/edit

func (WidgetsResource) List

List gets all Widgets. This function is mapped to the path GET /widgets

func (WidgetsResource) New

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

func (WidgetsResource) Show

Show gets the data for one Widget. This function is mapped to the path GET /widgets/{widget_id}

func (WidgetsResource) Update

func (v WidgetsResource) Update(c buffalo.Context) error

Update changes a Widget in the DB. This function is mapped to the path PUT /widgets/{widget_id}

Jump to

Keyboard shortcuts

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