actions

package
v0.0.0-...-6a42fc5 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2021 License: MIT Imports: 35 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 i18n Translator

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 handles Provider callbacks

func AuthDestroy

func AuthDestroy(c buffalo.Context) error

AuthDestroy deletes the user's session

func Authorize

func Authorize(next buffalo.Handler) buffalo.Handler

Authorize makes sure a user is authorized to visit a page

func HomeHandler

func HomeHandler(c buffalo.Context) error

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

func JSONFeed

func JSONFeed(c buffalo.Context) error

JSONFeed API

func Privacy

func Privacy(c buffalo.Context) error

Privacy

func RSSFeed

func RSSFeed(c buffalo.Context) error

RSSFeed renders RSS feed

func SetCurrentUser

func SetCurrentUser(next buffalo.Handler) buffalo.Handler

SetCurrentUser finds and sets the logged in user

Types

type PostsResource

type PostsResource struct {
	buffalo.Resource
}

PostsResource is the resource for the post model

func (PostsResource) Create

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

Create adds a post to the DB. This function is mapped to the path POST /posts

func (PostsResource) Destroy

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

Destroy deletes a post from the DB. This function is mapped to the path DELETE /posts/{post_id}

func (PostsResource) Edit

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

Edit renders a edit formular for a post. This function is mapped to the path GET /posts/{post_id}/edit

func (PostsResource) List

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

List gets all Posts. This function is mapped to the path GET /posts

func (PostsResource) New

New renders the formular for creating a new post. This function is mapped to the path GET /posts/new

func (PostsResource) Show

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

Show gets the data for one Post. This function is mapped to the path GET /posts/{post_id}

func (PostsResource) Update

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

Update changes a post in the DB. This function is mapped to the path PUT /posts/{post_id}

type UsersResource

type UsersResource struct {
	buffalo.Resource
}

UsersResource is the resource for the user model

func (UsersResource) Create

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

Create adds a user to the DB. This function is mapped to the path POST /users

func (UsersResource) Destroy

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

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

func (UsersResource) Edit

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

Edit renders a edit formular for a user. This function is mapped to the path GET /users/{user_id}/edit

func (UsersResource) List

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

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

func (UsersResource) New

New renders the formular for creating a new user. This function is mapped to the path GET /users/new

func (UsersResource) Show

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

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

func (UsersResource) Update

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

Update changes a user in the DB. This function is mapped to the path PUT /users/{user_id}

Jump to

Keyboard shortcuts

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