mytemplate

package
v0.0.0-...-539ff05 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dict

func Dict(values ...interface{}) (map[string]interface{}, error)

func FolderContent

func FolderContent(w http.ResponseWriter, r *http.Request, data *[]DisplayEntry)
func Footer(w http.ResponseWriter)

func IncludeCSS

func IncludeCSS(path string) template.CSS

func IncludeHTML

func IncludeHTML(path string) template.HTML

func IncludeJS

func IncludeJS(path string) template.JS

func Index

func Index(w http.ResponseWriter, indexView *IndexView)

func NewTemplate

func NewTemplate() *template.Template

Types

type Category

type Category struct {
	Value       string
	DisplayText string
}

type DisplayEntry

type DisplayEntry struct {
	Name          string
	EntryType     types.EntryType
	UrlString     string
	FirstName     string
	LastName      string // File extension string if it's a file, or "/" if it's a folder
	IsCover       bool
	IsThumbnail   bool
	ModTimeString string
	ModTimeUnix   int64
	SizeString    string
	SizeInt       int64
	HasThumbnail  string
}

type IndexView

type IndexView struct {
	Title      string
	Dir        string
	Breadcrumb []mypath.BreadcrumbLevel
	Categories []Category
}

type ViewCategory

type ViewCategory string
const (
	Default    ViewCategory = "default"
	ImageVideo ViewCategory = "image_and_video"
	Music      ViewCategory = "music"
)

func (ViewCategory) String

func (v ViewCategory) String() string

func (ViewCategory) TemplateName

func (v ViewCategory) TemplateName() string

Jump to

Keyboard shortcuts

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