fsutil

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2019 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Overview

Package fsutil provides useful utility functions for http.FileSystem.

Index

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.

Jump to

Keyboard shortcuts

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