exploration

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitialFiles

func InitialFiles(rootDir string, ignores []Matcher) (directories []string, files []string, err error)

InitialFiles return all files and directories in the tree below rootDir and the rootDir itself. ignores is a list of relativ subdirs to ignore

Types

type Matcher

type Matcher interface {
	Match(string) bool
}

Matcher is a interface to abstract from gobwas/glob

func GobwasMatcherFromPatterns

func GobwasMatcherFromPatterns(patterns []string) ([]Matcher, error)

MatcherFromPatterns returns the matcher according to the given patterns or an error. It uses github.com/gobwas/glob to generate Matcher. Thus for the supported syntax have a look there.

type RecursiveWatcher

type RecursiveWatcher struct {
	Events chan fsnotify.Event
	Errors chan error
	// contains filtered or unexported fields
}

func NewRecursiveWatcher

func NewRecursiveWatcher(ctx context.Context, ignores []Matcher, initialDirs ...string) (*RecursiveWatcher, error)

NewRecursiveWatcher creates a new recursive file watcher. You can listen for errors and events via the channels Events and Errors

Jump to

Keyboard shortcuts

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