Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MagicFileNames ¶
type MagicFileNames []string
MagicFileNames holds a list (a []string) of "magic" files-names.
These, for example, could be the "magic" file-names that are looked for when a web-server is trying to provide a response for a request for a directory.
For example:
var magicFileNames libdir.MagicFileNames = lib.MagicFileNames{
"default.html",
"default.xhtml",
"index.html",
"index.xhtml",
"README.md",
}
These are used in its [Match] method.
func (MagicFileNames) Match ¶
func (receiver MagicFileNames) Match(dirEntries ...fs.DirEntry) (string, bool)
The `dirEntries` passed to Match are the fs.DirEntry of the files in a directory.
Match looks through that list of fs.DirEntry (`fileNames`) and looks for the "magic" file-names in its receiver.
The "magic" file-names in the receiver are in priority order. With the first one being the highest priority.
Click to show internal directories.
Click to hide internal directories.