views

package
v0.0.0-...-0fc1b25 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AlertMsgGeneric = "Something went wrong. Please try again, and contact us if the problem persists."
)

Variables

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

Functions

This section is empty.

Types

type Data

type Data struct {
	IsSessionActive bool
	LogoutURL       string
	LogoutToken     string
	Yield           interface{}
}

Data is the top level structure that views expect data to come in.

type View

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

func NewView

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

func (*View) Render

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

Render is used to render the view with predefined layout

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