Documentation
¶
Index ¶
- func AddNoteToRecipePost(resp http.ResponseWriter, req *http.Request, p httprouter.Params)
- func AttachToRecipePost(resp http.ResponseWriter, req *http.Request, p httprouter.Params)
- func CreateRecipe(resp http.ResponseWriter, req *http.Request, p httprouter.Params)
- func CreateRecipePost(resp http.ResponseWriter, req *http.Request, p httprouter.Params)
- func DeleteRecipe(resp http.ResponseWriter, req *http.Request, p httprouter.Params)
- func EditRecipe(resp http.ResponseWriter, req *http.Request, p httprouter.Params)
- func EditRecipePost(resp http.ResponseWriter, req *http.Request, p httprouter.Params)
- func GetRecipe(resp http.ResponseWriter, req *http.Request, p httprouter.Params)
- func Home(resp http.ResponseWriter, req *http.Request)
- func InternalServerError(resp http.ResponseWriter, err error)
- func ListRecipes(resp http.ResponseWriter, req *http.Request, p httprouter.Params)
- func NotFound(resp http.ResponseWriter, req *http.Request)
- func RedirectIfHasError(resp http.ResponseWriter, err error) bool
- type AttachmentForm
- type NoteForm
- type RecipeForm
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddNoteToRecipePost ¶
func AddNoteToRecipePost(resp http.ResponseWriter, req *http.Request, p httprouter.Params)
func AttachToRecipePost ¶
func AttachToRecipePost(resp http.ResponseWriter, req *http.Request, p httprouter.Params)
func CreateRecipe ¶
func CreateRecipe(resp http.ResponseWriter, req *http.Request, p httprouter.Params)
CreateRecipe handles rendering the create recipe screen
func CreateRecipePost ¶
func CreateRecipePost(resp http.ResponseWriter, req *http.Request, p httprouter.Params)
CreateRecipePost handles processing the supplied form input from the create recipe screen
func DeleteRecipe ¶
func DeleteRecipe(resp http.ResponseWriter, req *http.Request, p httprouter.Params)
DeleteRecipe handles deleting the recipe with the given id
func EditRecipe ¶
func EditRecipe(resp http.ResponseWriter, req *http.Request, p httprouter.Params)
EditRecipe handles rendering the edit recipe screen
func EditRecipePost ¶
func EditRecipePost(resp http.ResponseWriter, req *http.Request, p httprouter.Params)
EditRecipePost handles processing the supplied form input from the edit recipe screen
func GetRecipe ¶
func GetRecipe(resp http.ResponseWriter, req *http.Request, p httprouter.Params)
GetRecipe handles retrieving and rendering a single recipe
func Home ¶
func Home(resp http.ResponseWriter, req *http.Request)
Home handles rending the default home page
func InternalServerError ¶
func InternalServerError(resp http.ResponseWriter, err error)
InternalServerError handles 500 errors
func ListRecipes ¶
func ListRecipes(resp http.ResponseWriter, req *http.Request, p httprouter.Params)
ListRecipes handles retrieving and rending a list of available recipes
func NotFound ¶
func NotFound(resp http.ResponseWriter, req *http.Request)
NotFound handles 404 errors
func RedirectIfHasError ¶
func RedirectIfHasError(resp http.ResponseWriter, 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 `form:"note"`
}
NoteForm encapsulates user input for a note on a recipe