Documentation
¶
Overview ¶
Package fsutil provides useful utility functions for http.FileSystem.
Index ¶
- func TmplParse(fs http.FileSystem, tmpl *txttmpl.Template, paths ...string) (*txttmpl.Template, error)
- func TmplParseGlob(fs http.FileSystem, tmpl *txttmpl.Template, pattern string) (*txttmpl.Template, error)
- func TmplParseGlobHTML(fs http.FileSystem, tmpl *htmltmpl.Template, pattern string) (*htmltmpl.Template, error)
- func TmplParseHTML(fs http.FileSystem, tmpl *htmltmpl.Template, paths ...string) (*htmltmpl.Template, error)
- func Walk(hfs http.FileSystem, root string) *fs.Walker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TmplParse ¶
func TmplParse(fs http.FileSystem, tmpl *txttmpl.Template, paths ...string) (*txttmpl.Template, error)
TmplParse parses templates from the given filesystem according to the given paths. If tmpl is not nil, the templates will be added to it. paths must contain at least one path. All paths must exist in the given filesystem.
func TmplParseGlob ¶
func TmplParseGlob(fs http.FileSystem, tmpl *txttmpl.Template, pattern string) (*txttmpl.Template, error)
TmplParseGlob parses templates from the given filesystem according to the provided glob pattern. If tmpl is not nil, the templates will be added to it.
func TmplParseGlobHTML ¶
func TmplParseGlobHTML(fs http.FileSystem, tmpl *htmltmpl.Template, pattern string) (*htmltmpl.Template, error)
TmplParseGlobHTML parses HTML templates from the given filesystem according to the provided glob pattern. If tmpl is not nil, the templates will be added to it.
func TmplParseHTML ¶
func TmplParseHTML(fs http.FileSystem, tmpl *htmltmpl.Template, paths ...string) (*htmltmpl.Template, error)
TmplParseHTML parses HTML templates from the given filesystem according to the given paths. If tmpl is not nil, the templates will be added to it. paths must contain at least one path. All paths must exist in the given filesystem.
func Walk ¶
func Walk(hfs http.FileSystem, root string) *fs.Walker
Walk returns a fs.Walker over http.FileSystem, which enables walking over all files in the filesystem.
See https://godoc.org/github.com/kr/fs#Walker for more details.
Types ¶
This section is empty.