Documentation
¶
Overview ¶
Package fs contains an HTTP file system that works with zip contents.
Index ¶
- func New() (http.FileSystem, error)
- func NewWithNamespace(assetNamespace string) (http.FileSystem, error)
- func ReadFile(hfs http.FileSystem, name string) ([]byte, error)
- func Register(data string)
- func RegisterWithNamespace(assetNamespace string, data string)
- func Walk(hfs http.FileSystem, root string, walkFn filepath.WalkFunc) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New() (http.FileSystem, error)
New creates a new file system with the default registered zip contents data. It unzips all files and stores them in an in-memory map.
func NewWithNamespace ¶ added in v0.1.7
func NewWithNamespace(assetNamespace string) (http.FileSystem, error)
NewWithNamespace creates a new file system with the registered zip contents data. It unzips all files and stores them in an in-memory map.
func ReadFile ¶ added in v0.1.7
func ReadFile(hfs http.FileSystem, name string) ([]byte, error)
ReadFile reads the contents of the file of hfs specified by name. Just as ioutil.ReadFile does.
func Register ¶
func Register(data string)
Register registers zip contents data, later used to initialize the statik file system.
func RegisterWithNamespace ¶ added in v0.1.7
RegisterWithNamespace registers zip contents data and set asset namespace, later used to initialize the statik file system.
func Walk ¶ added in v0.1.7
Walk walks the file tree rooted at root, calling walkFn for each file or directory in the tree, including root. All errors that arise visiting files and directories are filtered by walkFn.
As with filepath.Walk, if the walkFn returns filepath.SkipDir, then the directory is skipped.
Types ¶
This section is empty.