Documentation
¶
Index ¶
- type Folder
- func (f *Folder) Cache(w http.ResponseWriter, fileName string)
- func (f *Folder) Handler() (func(w http.ResponseWriter, r *http.Request), error)
- func (f *Folder) Middleware() (func(http.Handler) http.Handler, error)
- func (f *Folder) ServeContent(w http.ResponseWriter, req *http.Request, name string, modtime time.Time, ...)
- func (f *Folder) SetCustomContent(...)
- func (f *Folder) SetFs(fs http.FileSystem)
- type RegexCacheStore
- type RegexPathStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Folder ¶
type Folder struct {
// BasePath for better UI browser expriance and not show .. if already in base path
BasePath string `cfg:"base_path"`
// Path is the path to the folder
Path string `cfg:"path"`
// Index is automatically redirect to index.html
Index bool `cfg:"index"`
// StripIndexName is strip index name from url
StripIndexName bool `cfg:"strip_index_name"`
// IndexName is the name of the index file, default is index.html
IndexName string `cfg:"index_name"`
// SPA is automatically redirect to index.html
SPA bool `cfg:"spa"`
// SPAEnableFile is enable .* file to be served to index.html if not found, default is false
SPAEnableFile bool `cfg:"spa_enable_file"`
// SPAIndex is set the index.html location, default is IndexName
SPAIndex string `cfg:"spa_index"`
// SPAIndexRegex set spa_index from URL path regex
SPAIndexRegex []*RegexPathStore `cfg:"spa_index_regex"`
// Browse is enable directory browsing
Browse bool `cfg:"browse"`
// UTC browse time format
UTC bool `cfg:"utc"`
// PrefixPath for strip prefix path for real file path
PrefixPath string `cfg:"prefix_path"`
// FilePathRegex is regex replacement for real file path, comes after PrefixPath apply
// File path doesn't include / suffix
FilePathRegex []*RegexPathStore `cfg:"file_path_regex"`
CacheRegex []*RegexCacheStore `cfg:"cache_regex"`
// BrowseCache is cache control for browse page, default is no-cache
BrowseCache string `cfg:"browse_cache"`
DisableFolderSlashRedirect bool `cfg:"disable_folder_slash_redirect"`
// contains filtered or unexported fields
}
func (*Folder) ServeContent ¶
func (f *Folder) ServeContent(w http.ResponseWriter, req *http.Request, name string, modtime time.Time, content io.ReadSeeker)
func (*Folder) SetCustomContent ¶
func (f *Folder) SetCustomContent(customContent func(r *http.Request, name string, content io.ReadSeeker) io.ReadSeeker)
func (*Folder) SetFs ¶
func (f *Folder) SetFs(fs http.FileSystem)
type RegexCacheStore ¶
type RegexPathStore ¶
Click to show internal directories.
Click to hide internal directories.