actions

package
v0.0.0-...-c6e3130 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: Apache-2.0 Imports: 13 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.

func HomeHandler

func HomeHandler(c buffalo.Context) error

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

Types

type TodoesResource

type TodoesResource struct {
	buffalo.Resource
}

TodoesResource is the resource for the Todo model

func (TodoesResource) Create

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

Create adds a Todo to the DB. This function is mapped to the path POST /todoes

func (TodoesResource) Destroy

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

Destroy deletes a Todo from the DB. This function is mapped to the path DELETE /todoes/{todo_id}

func (TodoesResource) Edit

func (v TodoesResource) Edit(c buffalo.Context) error

Edit renders a edit form for a Todo. This function is mapped to the path GET /todoes/{todo_id}/edit

func (TodoesResource) List

func (v TodoesResource) List(c buffalo.Context) error

List gets all Todoes. This function is mapped to the path GET /todoes

func (TodoesResource) New

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

func (TodoesResource) Show

func (v TodoesResource) Show(c buffalo.Context) error

Show gets the data for one Todo. This function is mapped to the path GET /todoes/{todo_id}

func (TodoesResource) Update

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

Update changes a Todo in the DB. This function is mapped to the path PUT /todoes/{todo_id}

Jump to

Keyboard shortcuts

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