watcher

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAssetType

func GetAssetType(path string) string

GetAssetType returns the asset type directory based on file extension

func IsAssetFile

func IsAssetFile(path string) bool

IsAssetFile checks if a file is an asset file (image, video, cast)

func IsMarkdownFile

func IsMarkdownFile(path string) bool

IsMarkdownFile checks if a file is a markdown file

func IsRelevantFile

func IsRelevantFile(path string) bool

IsRelevantFile checks if a file is relevant for documentation (markdown, images, etc.)

Types

type RecursiveWatcher

type RecursiveWatcher struct {
	*fsnotify.Watcher
	// contains filtered or unexported fields
}

RecursiveWatcher wraps fsnotify with recursive directory support. fsnotify is NOT recursive on Linux/POSIX, so we must explicitly watch all subdirectories and dynamically add watchers for new directories.

func New

func New() (*RecursiveWatcher, error)

New creates a new RecursiveWatcher

func (*RecursiveWatcher) AddRecursive

func (w *RecursiveWatcher) AddRecursive(root, workspacePath string) error

AddRecursive adds a directory and all its subdirectories to the watcher. The workspacePath is associated with all paths under root for later lookup.

func (*RecursiveWatcher) FindWorkspace

func (w *RecursiveWatcher) FindWorkspace(path string) string

FindWorkspace returns the workspace path for a given file path. It walks up the directory tree to find the watched parent.

func (*RecursiveWatcher) HandleNewDirectory

func (w *RecursiveWatcher) HandleNewDirectory(event fsnotify.Event, workspacePath string) bool

HandleNewDirectory checks if an event is a new directory and adds it to the watcher. Returns true if a new directory was added.

Jump to

Keyboard shortcuts

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