routers

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2016 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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

func (*AttachmentForm) FieldMap added in v0.2.0

func (f *AttachmentForm) FieldMap(req *http.Request) binding.FieldMap

FieldMap provides the AttachmentForm field name maping for form binding

type LoginForm added in v0.8.0

type LoginForm struct {
	Username string `form:"username"`
	Password string `form:"password"`
}

LoginForm encapsulates user input for the login screen

func (*LoginForm) FieldMap added in v0.8.0

func (f *LoginForm) FieldMap(req *http.Request) binding.FieldMap

FieldMap provides the LoginForm field name maping for form binding

type NoteForm

type NoteForm struct {
	Note string `form:"note"`
}

NoteForm encapsulates user input for a note on a recipe

func (*NoteForm) FieldMap added in v0.2.0

func (f *NoteForm) FieldMap(req *http.Request) binding.FieldMap

FieldMap provides the NoteForm field name maping for form binding

type RatingForm added in v0.4.0

type RatingForm struct {
	Rating float64 `form:"rating"`
}

RatingForm encapsulates user input for rating a recipe (1-5)

func (*RatingForm) FieldMap added in v0.4.0

func (f *RatingForm) FieldMap(req *http.Request) binding.FieldMap

FieldMap provides the RatingForm field name maping for form binding

type RecipeForm

type RecipeForm struct {
	Name          string   `form:"name"`
	ServingSize   string   `form:"serving-size"`
	NutritionInfo string   `form:"nutrition-info"`
	Ingredients   string   `form:"ingredients"`
	Directions    string   `form:"directions"`
	Tags          []string `form:"tags"`
}

RecipeForm encapsulates user input on the Create and Edit recipe screens

func (*RecipeForm) FieldMap added in v0.2.0

func (f *RecipeForm) FieldMap(req *http.Request) binding.FieldMap

FieldMap provides the RecipeForm field name maping for form binding

type RouteController added in v0.3.0

type RouteController struct {
	*render.Render
	// contains filtered or unexported fields
}

RouteController encapsulates the routes for the application

func NewController added in v0.3.0

func NewController(render *render.Render, cfg *conf.Config, model *models.Model, sessionStore sessions.Store) *RouteController

NewController constructs a RouteController

func (*RouteController) CreateAttachmentPost added in v0.6.0

func (rc *RouteController) CreateAttachmentPost(resp http.ResponseWriter, req *http.Request, p httprouter.Params)

CreateAttachmentPost handles uploading the specified attachment (image) to a recipe

func (*RouteController) CreateNotePost added in v0.6.0

func (rc *RouteController) CreateNotePost(resp http.ResponseWriter, req *http.Request, p httprouter.Params)

CreateNotePost handles processing the supplied form input for adding a note to a recipe

func (*RouteController) CreateRecipe added in v0.3.0

func (rc *RouteController) CreateRecipe(resp http.ResponseWriter, req *http.Request, p httprouter.Params)

CreateRecipe handles rendering the create recipe screen

func (*RouteController) CreateRecipePost added in v0.3.0

func (rc *RouteController) CreateRecipePost(resp http.ResponseWriter, req *http.Request, p httprouter.Params)

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

func (*RouteController) DeleteAttachment added in v0.6.0

func (rc *RouteController) DeleteAttachment(resp http.ResponseWriter, req *http.Request, p httprouter.Params)

DeleteAttachment handles deleting the specified attachment (image) from a recipe

func (*RouteController) DeleteNote added in v0.6.0

func (rc *RouteController) DeleteNote(resp http.ResponseWriter, req *http.Request, p httprouter.Params)

DeleteNote handles deleting the note with the given id

func (*RouteController) DeleteRecipe added in v0.3.0

func (rc *RouteController) DeleteRecipe(resp http.ResponseWriter, req *http.Request, p httprouter.Params)

DeleteRecipe handles deleting the recipe with the given id

func (*RouteController) EditNotePost added in v0.6.1

func (rc *RouteController) EditNotePost(resp http.ResponseWriter, req *http.Request, p httprouter.Params)

EditNotePost handles processing the supplied form input for adding a note to a recipe

func (*RouteController) EditRecipe added in v0.3.0

func (rc *RouteController) EditRecipe(resp http.ResponseWriter, req *http.Request, p httprouter.Params)

EditRecipe handles rendering the edit recipe screen

func (*RouteController) EditRecipePost added in v0.3.0

func (rc *RouteController) EditRecipePost(resp http.ResponseWriter, req *http.Request, p httprouter.Params)

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

func (*RouteController) GetRecipe added in v0.3.0

func (rc *RouteController) GetRecipe(resp http.ResponseWriter, req *http.Request, p httprouter.Params)

GetRecipe handles retrieving and rendering a single recipe

func (*RouteController) HasError added in v0.8.0

func (rc *RouteController) HasError(resp http.ResponseWriter, err error) bool

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

func (*RouteController) Home added in v0.3.0

func (rc *RouteController) Home(resp http.ResponseWriter, req *http.Request)

Home handles rending the default home page

func (*RouteController) InternalServerError added in v0.3.0

func (rc *RouteController) InternalServerError(resp http.ResponseWriter, err error)

InternalServerError handles 500 errors

func (*RouteController) ListRecipes added in v0.3.0

func (rc *RouteController) ListRecipes(resp http.ResponseWriter, req *http.Request, p httprouter.Params)

ListRecipes handles retrieving and rending a list of available recipes

func (*RouteController) Login added in v0.8.0

func (rc *RouteController) Login(resp http.ResponseWriter, req *http.Request, p httprouter.Params)

func (*RouteController) LoginPost added in v0.8.0

func (rc *RouteController) LoginPost(resp http.ResponseWriter, req *http.Request, p httprouter.Params)

func (*RouteController) Logout added in v0.8.0

func (rc *RouteController) Logout(resp http.ResponseWriter, req *http.Request, p httprouter.Params)

func (*RouteController) NoOp added in v0.8.0

func (rc *RouteController) NoOp(resp http.ResponseWriter, req *http.Request)

func (*RouteController) NotFound added in v0.3.0

func (rc *RouteController) NotFound(resp http.ResponseWriter, req *http.Request)

NotFound handles 404 errors

func (*RouteController) RateRecipePost added in v0.4.0

func (rc *RouteController) RateRecipePost(resp http.ResponseWriter, req *http.Request, p httprouter.Params)

RateRecipePost handles adding/updating the rating of a recipe

func (*RouteController) RequireAuthentication added in v0.8.0

func (rc *RouteController) RequireAuthentication(h negroni.Handler) negroni.HandlerFunc

Jump to

Keyboard shortcuts

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