handlers

package
v0.0.0-...-75fe9c3 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApproveMemory

func ApproveMemory(c echo.Context) error

ApproveMemory approves the Memory corresponding to the uuid parameter.

func CreateMemory

func CreateMemory(c echo.Context) error

CreateMemory creates a new Memory using values from a submitted form.

func EditMemory

func EditMemory(c echo.Context) error

EditMemory updates the details of a previously saved memory.

func GetAbout

func GetAbout(c echo.Context) error

GetAbout renders the About page.

func GetAddMemory

func GetAddMemory(c echo.Context) error

GetAddMemory renders the create memory form.

func GetEditMemory

func GetEditMemory(c echo.Context) error

GetEditMemory renders the memory form using the memory for the given uuid parameter.

func GetMemories

func GetMemories(c echo.Context) error

GetMemories renders all approved memories.

func GetMemory

func GetMemory(c echo.Context) error

GetMemory renders the memory details page for the corresponding memory id parameter.

func GetMemorySubmitted

func GetMemorySubmitted(c echo.Context) error

GetMemorySubmitted renders the memory submitted success page.

func Index

func Index(c echo.Context) error

Index renders the home page.

func MarkDownBasic

func MarkDownBasic(args ...interface{}) template.HTML

MarkDownBasic passes the given data to the MarkdownBasic formatter.

func Render

func Render(c echo.Context, templ string, data interface{}, err error) error

Render will render the given templ template passing in data if err is nil, or will render a 404 or 500 error page depending on the err.

func RenderContext

func RenderContext(c echo.Context, templ string, ctx TemplateContext) error

RenderContext will render the given templ template passing in the ctx TemplateContext.

func RenderMessage

func RenderMessage(c echo.Context, status int, message string) error

RenderMessage displays message using the message.html template.

func Setup

func Setup(e *echo.Echo, isDebug bool)

Setup sets the memory handlers and renderer on the Echo instance.

Types

type Template

type Template struct {
	// contains filtered or unexported fields
}

Template represents the parsed templates from the "templates" directory.

func (*Template) Render

func (t *Template) Render(w io.Writer, name string, data interface{}, c echo.Context) error

Render renders the template referenced by name and passes the data value into the template. If main was run with the debug argument, the templates are re-parsed on each call to Render.

type TemplateContext

type TemplateContext struct {
	Data interface{}
	Err  error
}

A TemplateContext holds data and an error that are passed in to a template for rendering. Either Data or Err can be nil.

Jump to

Keyboard shortcuts

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