Documentation
¶
Overview ¶
Package filter implements the result filters used by fd: size, modification time and (on unix) ownership constraints.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OwnerFilter ¶
type OwnerFilter struct {
// contains filtered or unexported fields
}
OwnerFilter constrains results by owning user and/or group.
func ParseOwner ¶
func ParseOwner(input string) (OwnerFilter, bool, error)
ParseOwner parses an owner constraint of the form [(user|uid)][:(group|gid)]. Either side may be prefixed with '!' to negate. Returns ok=false when the constraint is a no-op (e.g. "" or ":").
type SizeFilter ¶
SizeFilter constrains results based on file size.
func ParseSize ¶
func ParseSize(s string) (SizeFilter, error)
ParseSize parses a size constraint string like "+1m", "-500k", "10ki".
func (SizeFilter) IsWithin ¶
func (f SizeFilter) IsWithin(size uint64) bool
IsWithin reports whether the given size satisfies the filter.
type TimeFilter ¶
TimeFilter constrains results based on modification time.
func After ¶
func After(s string) (TimeFilter, error)
After returns a filter matching files modified after the given time spec.
func Before ¶
func Before(s string) (TimeFilter, error)
Before returns a filter matching files modified before the given time spec.