file

package
v0.6.9 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Find

func Find(root string, opts ...FindOption) ([]string, error)

Find functions similarly to GNU find searching recursively from root for all entites which match the given options. By default all entity types (file, directory) will be returned including the root directory.

Types

type EntType

type EntType string

EntType describes the entity types which a filesystem may contain.

const (
	// EntTypeNone matches no entities.
	EntTypeNone EntType = ""
	// EntTypeAll matches all entity types.
	EntTypeAll EntType = "all"
	// EntTypeDir matches directory entities.
	EntTypeDir EntType = "dir"
	// EntTypeFile matches file entities.
	EntTypeFile EntType = "file"
)

type FindOption

type FindOption interface {
	ConfigureFind(*findConfig)
}

type WithEntType

type WithEntType EntType

WithEntType selects which entity types will be matched by the find function.

func (WithEntType) ConfigureFind

func (t WithEntType) ConfigureFind(c *findConfig)

type WithName

type WithName string

WithName supplies a glob pattern to filter the matched entities to only those which match the glob.

func (WithName) ConfigureFind

func (n WithName) ConfigureFind(c *findConfig)

Jump to

Keyboard shortcuts

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