templates

package
v4.0.0-release+incompa... Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package templates handles building and showing HTML files used to build the GUI.

Index

Constants

This section is empty.

Variables

View Source
var Config = config{
	PathToTemplates: "./website/templates/",
	Development:     false,
	UseLocalFiles:   false,
}

Config is a copy of the config struct with some defaults set

Functions

func Load

func Load(w http.ResponseWriter, templateName string, data interface{})

Load shows a template to the client, show the GUI

func SetConfig

func SetConfig(c config)

SetConfig saves the configuration options for serving templates/html pages

Types

type NotificationPage

type NotificationPage struct {
	PanelColor string
	Title      string
	Message    interface{} //interface{} because this could be a string or an error
	BtnColor   string
	LinkHref   string
	BtnText    string
}

NotificationPage is used to display error or warning messages in the GUI Defining a struct makes it so the GUI is consistently displayed.

Jump to

Keyboard shortcuts

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