Documentation ¶
Index ¶
- Variables
- func App() *buffalo.App
- type WidgetsResource
- func (v WidgetsResource) Create(c buffalo.Context) error
- func (v WidgetsResource) Destroy(c buffalo.Context) error
- func (v WidgetsResource) Edit(c buffalo.Context) error
- func (v WidgetsResource) List(c buffalo.Context) error
- func (v WidgetsResource) New(c buffalo.Context) error
- func (v WidgetsResource) Show(c buffalo.Context) error
- func (v WidgetsResource) 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
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.
Types ¶
type WidgetsResource ¶
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 ¶
func (v WidgetsResource) Edit(c buffalo.Context) error
Edit renders a edit form for a Widget. This function is mapped to the path GET /widgets/{widget_id}/edit
func (WidgetsResource) List ¶
func (v WidgetsResource) List(c buffalo.Context) error
List gets all Widgets. This function is mapped to the path GET /widgets
func (WidgetsResource) New ¶
func (v WidgetsResource) New(c buffalo.Context) error
New renders the form for creating a new Widget. This function is mapped to the path GET /widgets/new