Documentation ¶
Index ¶
- Variables
- func CurrentUser(u interface{}) (string, func() interface{})
- func Env(e string) (string, func() string)
- func Nonce() (string, func() string)
- func RootUrl(u *url.URL) (string, func() string)
- func TagPacker(env string, filesys fs.FS) func(string, bool) html.HTML
- type Parse
- type Parser
- type ParserOptFn
Constants ¶
This section is empty.
Variables ¶
var (
ErrNoFiles = errors.New("no files provided")
)
Functions ¶
func CurrentUser ¶
func CurrentUser(u interface{}) (string, func() interface{})
CurrentUser encloses some value representing a user. It returns "currentUser" as the name of the function for convenient passing to a template.FuncMap and returns a function returning the enclosed value when called.
func Env ¶
Env encloses some string representing an environment. It returns "env" as the name of the function for convenient passing to a template.FuncMap and returns a function returning the enclosed value when called.
func Nonce ¶
Nonce returns "nonce" as the name of the function for convenient passing to a template.FuncMap and returns a function generating a uuid.
Types ¶
type Parse ¶
type Parse struct {
// contains filtered or unexported fields
}
Parse implements Parser with a focus on utilizing embedded HTML templates through fs.FS.
type Parser ¶
type Parser interface { AddFn(name string, fn interface{}) Parse(fps ...string) (*html.Template, error) }
Parser is the interface for parsing HTML templates with the functions provided.
type ParserOptFn ¶
type ParserOptFn func(*Parse)
The ParserOptFn applies functional options to a *Parse when constructing it.
func WithFn ¶
func WithFn(name string, fn interface{}) ParserOptFn
WithFn encloses a named function so it can be added to a *Parse's function map.
Directories ¶
Path | Synopsis |
---|---|
Cribbed from Mark Bates: https://www.gopherguides.com/articles/golang-1.16-io-fs-improve-test-performance
|
Cribbed from Mark Bates: https://www.gopherguides.com/articles/golang-1.16-io-fs-improve-test-performance |