views

package
v0.0.0-...-3263382 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AlertLvError    = "danger"
	AlertLvWarning  = "waring"
	AlertLvInfo     = "info"
	AlertLvSuccess  = "success"
	AlertMsgGeneric = "Something went wrong. Please try" +
		"again, and contact us if the problem persists."
)

Variables

View Source
var (
	LayoutDir   = "views/layouts/"
	TemplateDir = "views/"
	TemplateExt = ".gohtml"
)

Functions

func RedirectAlert

func RedirectAlert(c *gin.Context, urlStr string, code int, alert Alert)

Types

type Alert

type Alert struct {
	Level   string
	Message string
}

type PublicError

type PublicError interface {
	error
	Public() string
}

type Response

type Response struct {
	Alert *Alert
	User  *models.User
	Data  struct {
		Yield     interface{}
		CsrfField template.HTML
	}
}

func (*Response) AlertError

func (d *Response) AlertError(msg string)

func (*Response) SetAlert

func (d *Response) SetAlert(err error)

type View

type View struct {
	Name string
}

func NewView

func NewView(r *gin.Engine, name string, files ...string) *View

func (*View) HTML

func (v *View) HTML(c *gin.Context)

func (*View) Render

func (v *View) Render(c *gin.Context, code int, data interface{})

Jump to

Keyboard shortcuts

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