usnfilter

package
v0.0.0-...-5cdaeaf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package usnfilter provides convenient USN filtering functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func And

func And(filters ...usn.Filter) usn.Filter

And creates a new filter that returns true only when each filter in filters returns true.

If filters is empty, nil, or composed solely of nil filters, a nil filter will be returned.

func IsDir

func IsDir(record usn.Record) bool

IsDir is a filter that returns true returns true when a record represents a directory.

func Not

func Not(filter usn.Filter) usn.Filter

Not returns a new filter that returns true only when the given filter does not.

func Or

func Or(filters ...usn.Filter) usn.Filter

Or creates a new filter that returns true when at least one of the given filters returns true.

If filters is empty, nil, or composed solely of nil filters, a nil filter will be returned.

func PathContains

func PathContains(substr string) usn.Filter

PathContains returns a filter that returns true when a record's path contains the given substring. If the record does not specify a path its filename will be used instead. The match is case-insensitive.

func PathPrefix

func PathPrefix(prefix string) usn.Filter

PathPrefix returns a filter that returns true when a record's path starts with the given prefix. If the record does not specify a path its filename will be used instead. The match is case-insensitive.

func PathRegexp

func PathRegexp(re *regexp.Regexp) usn.Filter

PathRegexp returns a filter that returns true when records have a filename or path matching the given regular expression.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL