views

package
v0.0.0-...-c470439 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AlertLvlError   = "danger"
	AlertLvlWarning = "warning"
	AlertLvlInfo    = "info"
	AlertLvlSuccess = "success"

	AlertMsgGeneric = "Something went wrong. Please try again and contact us if the problem persists."
)

Variables

This section is empty.

Functions

func RedirectWithAlert

func RedirectWithAlert(w http.ResponseWriter, r *http.Request, url string, code int, a Alert)

Types

type Alert

type Alert struct {
	Level   string
	Message string
}

type Data

type Data struct {
	Alert *Alert
	User  *models.User
	Yield interface{}
}

func (*Data) AlertError

func (d *Data) AlertError(msg string)

func (*Data) SetAlert

func (d *Data) SetAlert(err error)

type PublicError

type PublicError interface {
	error
	Public() string
}

type View

type View struct {
	Template *template.Template
	// contains filtered or unexported fields
}

func NewView

func NewView(layout string, files ...string) *View

func (*View) Render

func (v *View) Render(w http.ResponseWriter, r *http.Request, data interface{})

func (*View) ServeHTTP

func (v *View) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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