routers

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNoteToRecipePost

func AddNoteToRecipePost(ctx *macaron.Context, form NoteForm)

func AttachToRecipePost

func AttachToRecipePost(ctx *macaron.Context, form AttachmentForm)

func CreateRecipe

func CreateRecipe(ctx *macaron.Context)

CreateRecipe handles rendering the create recipe screen

func CreateRecipePost

func CreateRecipePost(ctx *macaron.Context, form RecipeForm)

CreateRecipePost handles processing the supplied form input from the create recipe screen

func DeleteRecipe

func DeleteRecipe(ctx *macaron.Context)

DeleteRecipe handles deleting the recipe with the given id

func EditRecipe

func EditRecipe(ctx *macaron.Context)

EditRecipe handles rendering the edit recipe screen

func EditRecipePost

func EditRecipePost(ctx *macaron.Context, form RecipeForm)

EditRecipePost handles processing the supplied form input from the edit recipe screen

func GetRecipe

func GetRecipe(ctx *macaron.Context)

GetRecipe handles retrieving and rendering a single recipe

func Home

func Home(ctx *macaron.Context)

Home handles rending the default home page

func InternalServerError

func InternalServerError(ctx *macaron.Context, err error)

InternalServerError handles 500 errors

func ListRecipes

func ListRecipes(ctx *macaron.Context)

ListRecipes handles retrieving and rending a list of available recipes

func NotFound

func NotFound(ctx *macaron.Context)

NotFound handles 404 errors

func RedirectIfHasError

func RedirectIfHasError(ctx *macaron.Context, err error) bool

RedirectIfHasError sends the request to the InternalServerError page if the asupplied error is not nil

Types

type AttachmentForm

type AttachmentForm struct {
	FileName    string                `form:"file_name"`
	FileContent *multipart.FileHeader `form:"file_content"`
}

AttachmentForm encapsulates user input for attaching a file (image) to a recipe

type NoteForm

type NoteForm struct {
	Note string
}

NoteForm encapsulates user input for a note on a recipe

type RecipeForm

type RecipeForm struct {
	Name        string `binding:"Required"`
	Description string
	Ingredients string
	Directions  string
	Tags        []string
}

RecipeForm encapsulates user input on the Create and Edit recipe screens

Jump to

Keyboard shortcuts

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