utils

package
v0.0.0-...-a79a8e1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TemplatePrefix = "views"
	AdminPrefix    = "internal"
	TextPrefix     = "text"
)

Variables

View Source
var AdminTemplates = []string{
	"partials/header.gohtml",
	"partials/footer.gohtml",
	"elements/adminbar.gohtml",
	"partials/base.gohtml",
}
View Source
var BaseTemplates = []string{
	"partials/header.gohtml",
	"partials/footer.gohtml",
	"elements/navbar.gohtml",
	"partials/base.gohtml",
}

Functions

func NewDBFromConfig

func NewDBFromConfig(db structs.Database) *database.Queries

func PrefixURL

func PrefixURL(url, p string) string

func RenderContent

func RenderContent(w http.ResponseWriter, context structs.PageContext, data interface{}, content string) error

func RenderHTML

func RenderHTML(value interface{}) template.HTML

func RenderICal

func RenderICal(w http.ResponseWriter, data interface{}, text string) error

func RenderTemplates

func RenderTemplates(w http.ResponseWriter, context structs.PageContext, data interface{}, templates ...string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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