template

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEmailView

func NewEmailView(templateName string) (*template.Template, error)

Types

type Data

type Data struct {
	User struct {
		ID    string
		Admin bool
	}
	ErrorMessages []string
	Messages      struct {
		Success string
		Info    string
	}
	Yield interface{}
}

type View

type View struct {
	Template *template.Template
	Layout   string
}

func NewView

func NewView(templateName string) *View

func (*View) Error

func (v *View) Error(w http.ResponseWriter, r *http.Request, yield interface{}, err error)

Error renders the self defined error message.

func (*View) Render

func (v *View) Render(w http.ResponseWriter, r *http.Request, yield interface{}, ErrorMessages []string)

Render is used to render the view with the predefined layout.

func (*View) Success

func (v *View) Success(w http.ResponseWriter, r *http.Request, yield interface{}, message string)

Success renders the self defined success message.

Jump to

Keyboard shortcuts

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