Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DirCache ¶
type DirCache struct {
// contains filtered or unexported fields
}
A DirCache is an http.Handler for serving static files.
Files within the directory are cached; if a file is changed, an inotify mechanism will invalidate the cache.
There is no limit to how much data will be cached.
func Dir ¶
Dir returns a DirCache serving files in the given directory.
func (*DirCache) Close ¶
func (d *DirCache) Close()
Close should be called to clean up the cached resources and stop the inotify watcher if this DirCache is no longer necessary.
type FileCache ¶
type FileCache struct {
// contains filtered or unexported fields
}
A FileCache is an http.Handler for serving a single static file.
The file's contents will be cached; if the file is changed, an inotify mechanism will invalidate the cache.
There is no limit to how much data will be cached.
func File ¶
File returns an http.Handler for serving a single static file.