watcher

package
v0.0.0-...-d55067e Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Watcher

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

Watcher recursively watches the vault root and fans out change events to any subscribed channels. Mirrors the chokidar-based watcher in src/main/watcher.ts.

func Disabled

func Disabled(root string) *Watcher

Disabled returns a watcher that does no filesystem watching. It still supports Subscribe/Close so the rest of the server can treat it like a real watcher; it simply never emits change events. Used where inotify is unavailable or explicitly turned off — notably unprivileged LXC containers, where inotify operations can wedge the process (unkillable, bind-mount locked) instead of returning an error. (#179)

func Start

func Start(root string) (*Watcher, error)

func StartOrDisabled

func StartOrDisabled(root string, disable bool) *Watcher

StartOrDisabled starts a real watcher, or falls back to a no-op watcher when watching is turned off (disable) or unavailable. It never returns an error, so the server can always serve the vault even where inotify is restricted. (#179)

func (*Watcher) Active

func (w *Watcher) Active() bool

Active reports whether this watcher really watches the filesystem. The Disabled fallback (inotify unavailable or explicitly off, #179) has no fsnotify handle and never emits an event; capabilities must not promise live updates it cannot deliver, or clients skip polling AND never hear about changes.

func (*Watcher) Close

func (w *Watcher) Close()

func (*Watcher) SetFolderPaths

func (w *Watcher) SetFolderPaths(paths map[string]string)

func (*Watcher) Subscribe

func (w *Watcher) Subscribe() (<-chan vault.ChangeEvent, func())

Jump to

Keyboard shortcuts

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