views

package
v0.0.0-...-17df326 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AlertLvlError   = "danger"
	AlertLvlSuccess = "success"
	AlertMsgGeneric = "Something went wrong"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	Level   string
	Message string
}

Alert model represents general purpose alert box below header in templates

type Data

type Data struct {
	Alert *Alert
	Yield interface{}
}

Data represents top level structure that views can expect

type View

type View struct {
	Err      error
	Template *template.Template
}

View type containing template and error

func New

func New(files ...string) *View

New parses a template for html

func (*View) Render

func (v *View) Render(w http.ResponseWriter, lyt string, data interface{}) error

Render the view

Jump to

Keyboard shortcuts

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