package glob
import "github.com/gohugoio/hugo/hugofs/glob"
Index ¶
- func FilterGlobParts(a []string) []string
- func GetGlob(pattern string) (glob.Glob, error)
- func HasGlobChar(s string) bool
- func NormalizePath(p string) string
- func NormalizePathNoLower(p string) string
- func ResolveRootDir(p string) string
- type FilenameFilter
- func MustNewFilenameFilter(inclusions, exclusions []string) *FilenameFilter
- func NewFilenameFilter(inclusions, exclusions []string) (*FilenameFilter, error)
- func NewFilenameFilterForInclusionFunc(shouldInclude func(filename string) bool) *FilenameFilter
- func (f *FilenameFilter) Match(filename string, isDir bool) bool
Functions ¶
func FilterGlobParts ¶
FilterGlobParts removes any string with glob wildcard.
func GetGlob ¶
func HasGlobChar ¶
HasGlobChar returns whether s contains any glob wildcards.
func NormalizePath ¶
func NormalizePathNoLower ¶
func ResolveRootDir ¶
ResolveRootDir takes a normalized path on the form "assets/**.json" and determines any root dir, i.e. any start path without any wildcards.
Types ¶
type FilenameFilter ¶
type FilenameFilter struct {
// contains filtered or unexported fields
}
func MustNewFilenameFilter ¶
func MustNewFilenameFilter(inclusions, exclusions []string) *FilenameFilter
MustNewFilenameFilter invokes NewFilenameFilter and panics on error.
func NewFilenameFilter ¶
func NewFilenameFilter(inclusions, exclusions []string) (*FilenameFilter, error)
NewFilenameFilter creates a new Glob where the Match method will return true if the file should be included. Note that the inclusions will be checked first.
func NewFilenameFilterForInclusionFunc ¶
func NewFilenameFilterForInclusionFunc(shouldInclude func(filename string) bool) *FilenameFilter
NewFilenameFilterForInclusionFunc create a new filter using the provided inclusion func.
func (*FilenameFilter) Match ¶
func (f *FilenameFilter) Match(filename string, isDir bool) bool
Match returns whether filename should be included.
Source Files ¶
- Version
- v0.104.0
- Published
- Sep 23, 2022
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 3 hours ago –
Tools for package owners.