package hglob
import "github.com/gohugoio/hugo/hugofs/hglob"
Index ¶
- Constants
- func FilterGlobParts(a []string) []string
- func GetGlob(pattern string) (glob.Glob, error)
- func GetGlobDot(pattern string) (glob.Glob, error)
- func HasGlobChar(s string) bool
- func NewGlobIdentity(pattern string) identity.Identity
- func NormalizePath(p string) string
- func NormalizePathNoLower(p string) string
- func Or(globs ...glob.Glob) glob.Glob
- 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 NewFilenameFilterV2(patterns []string) (*FilenameFilter, error)
- func (f *FilenameFilter) Append(other *FilenameFilter) *FilenameFilter
- func (f *FilenameFilter) Match(filename string, isDir bool) bool
- type MatchesFunc
Constants ¶
const NegationPrefix = "! "
NegationPrefix is the prefix that makes a pattern an exclusion.
Functions ¶
func FilterGlobParts ¶
FilterGlobParts removes any string with glob wildcard.
func GetGlob ¶
func GetGlobDot ¶
GetGlobDot returns a glob.Glob that matches the given pattern, using '.' as the path separator.
func HasGlobChar ¶
HasGlobChar returns whether s contains any glob wildcards.
func NewGlobIdentity ¶
NewGlobIdentity creates a new Identity that is probably dependent on any other Identity that matches the given pattern.
func NormalizePath ¶
func NormalizePathNoLower ¶
func Or ¶
Or creates a new Glob from the given globs.
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. Deprecated: Use NewFilenameFilterV2.
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 exclusions will be checked first. Deprecated: Use NewFilenameFilterV2.
func NewFilenameFilterForInclusionFunc ¶
func NewFilenameFilterForInclusionFunc(shouldInclude func(filename string) bool) *FilenameFilter
NewFilenameFilterForInclusionFunc create a new filter using the provided inclusion func.
func NewFilenameFilterV2 ¶
func NewFilenameFilterV2(patterns []string) (*FilenameFilter, error)
func (*FilenameFilter) Append ¶
func (f *FilenameFilter) Append(other *FilenameFilter) *FilenameFilter
Append appends a filter to the chain. The receiver will be copied if needed.
func (*FilenameFilter) Match ¶
func (f *FilenameFilter) Match(filename string, isDir bool) bool
Match returns whether filename should be included.
type MatchesFunc ¶
MatchesFunc is a convenience type to create a glob.Glob from a function.
func (MatchesFunc) Match ¶
func (m MatchesFunc) Match(s string) bool
Source Files ¶
- Version
- v0.153.4 (latest)
- Published
- Dec 28, 2025
- Platform
- linux/amd64
- Imports
- 10 packages
- Last checked
- 4 months ago –
Tools for package owners.