gorph

package module
v0.0.0-...-b242578 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 7 Imported by: 0

README

Gorph

Gorph is a recursive file watcher. It also handles "double-star" globs.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsDir

func IsDir(filesystem fs.FS, path string) bool

Types

type Gorph

type Gorph interface {
	fs.GlobFS
	Root() string
	Pattern() string
	Walk() ([]string, error)
	Folders() []string
	AddFolder(GorphEvent)
	RemoveFolder(GorphEvent)
	Children(path string) ([]string, error)
	Listen() (chan GorphEvent, chan error)
	Close() error
	WatchList() []string
}

Gorph is a file system that can do globbing

func NewGorph

func NewGorph(root string, pattern string, back fs.FS) (Gorph, error)

type GorphEvent

type GorphEvent struct {
	NotifyEvent *fsnotify.Event
	Op          GorphOp
	Path        string
}

func GorphEventFromNotifyEvent

func GorphEventFromNotifyEvent(g *gorph, fevent *fsnotify.Event) GorphEvent

func (GorphEvent) String

func (gevent GorphEvent) String() string

type GorphOp

type GorphOp uint8
const (
	UndefinedOp GorphOp = iota
	FsNotifyEvent
	FolderAdded
	FolderRemoved
	FolderRenamed
	FolderMoved
	FolderModified
	FolderUnknown
)

func (GorphOp) String

func (gop GorphOp) String() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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