actions

package
v0.0.0-...-baa06f7 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: MIT Imports: 12 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".

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.

Types

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