Documentation ¶
Overview ¶
Package fs contains an HTTP file system that works with zip contents.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ZipData string
Functions ¶
func ReadFile ¶ added in v0.2.0
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 statiq file system.
func Walk ¶ added in v0.2.0
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 ¶
type HttpFile ¶ added in v0.2.0
type HttpFile struct { File // contains filtered or unexported fields }
HttpFile represents an HTTP file and acts as a bridge between file and http.File.
func NewHTTPFile ¶ added in v0.2.0
func (*HttpFile) Readdir ¶ added in v0.2.0
Readdir returns an empty slice of files, directory listing is disabled.
type StatiqFS ¶ added in v0.2.1
func New ¶
New creates a new file system with the registered zip contents data. It unzips all files and stores them in an in-memory map.