fswatcher

package
v0.1.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EvCreate = eventType(iota)
	EvWrite
	EvRemove
	EvRemovePrefix
)
View Source
const (
	// Do or do not reindexing of path
	DoReindex = true
	NoReindex = false
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FSEvent

type FSEvent struct {
	Type eventType
}

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

func NewPool

func NewPool(paths []string, dbChan chan<- []*dbms.DBOperation, flushInterval time.Duration) *Pool

func (*Pool) NWatchers

func (p *Pool) NWatchers() int

func (*Pool) StartWatchers

func (p *Pool) StartWatchers(doReindex bool) error

func (*Pool) StopWatchers

func (p *Pool) StopWatchers()

func (*Pool) TermLong

func (p *Pool) TermLong()

TermLong terminates long-term operations on filesystem

type Watcher

type Watcher struct {
	// contains filtered or unexported fields
}

func NewWatcher

func NewWatcher(path string, flushInterval time.Duration,
	dbChan chan<- []*dbms.DBOperation) (*Watcher, error)

func (*Watcher) Path

func (w *Watcher) Path() string

func (*Watcher) Stop

func (w *Watcher) Stop()

Stop starts the watcher termination process. It does not block the caller.

func (*Watcher) TermLong

func (w *Watcher) TermLong()

TermLong terminates long-term operations on filesystem.

func (*Watcher) Wait

func (w *Watcher) Wait()

Wait blocks the caller until watcher is stopped.

func (*Watcher) Watch

func (w *Watcher) Watch(doReindex bool) error

Jump to

Keyboard shortcuts

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