Documentation ¶
Overview ¶
Package filter contains filters for the filesystem.
Index ¶
- func Consumes(path string, args []string) bool
- func Glob(path string, args []string) bool
- func Identifier(path string, args []string) bool
- func MIME(path string, args []string) bool
- func Name(path string, args []string) bool
- func Pattern(path string, args []string) bool
- func Size(path string, args []string) bool
- func Type(path string, args []string) bool
- type Filter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Glob ¶
Glob filter files that do not match the specified Unix Shell Glob. In the current implementation, the `*` character also coincides with `.` (dot). If the Glob provided does not contain the `/` character, only the last element of the route provided will be evaluated. In the opposite case, the entire route will be evaluated.
This filter takes exactly one argument.
func Identifier ¶
Identifier filter files that do not start with the magic number provided.
func Name ¶
Name filter files that do not have any name of the filter's arguments. For a route to pass the filter, it must end at least one of the names provided, for example:
Name(path, []string{"Img/Go"})
It will return true if `path` is one of:
- /home/gopher/Img/Go
- /Img/Go
- Img/Go
But, will be false if it is one of:
- MyImg/Go
- Go
- Img
This requires at least an argument.
func Pattern ¶
Pattern filter files that do not match regular expression provided. This filter takes exactly one argument.