watcher

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileChangedMsg

type FileChangedMsg struct{}

FileChangedMsg is sent when the watched file is modified.

type Watcher

type Watcher struct {
	Events chan tea.Msg // Channel to send messages back to Bubble Tea
	Errors chan error   // Channel to send errors (raw errors)
	// contains filtered or unexported fields
}

Watcher manages the file system watcher.

func New

func New() (*Watcher, error)

New creates a new Watcher.

func (*Watcher) Start

func (w *Watcher) Start(ctx context.Context, filePath string)

Start begins watching the specified file. It runs in a goroutine and sends events/errors on the respective channels.

func (*Watcher) WatchFileCmd

func (w *Watcher) WatchFileCmd() tea.Cmd

WatchFileCmd returns a command that listens for watcher events.

type WatcherErrMsg

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

WatcherErrMsg is sent when the watcher encounters an error.

func (WatcherErrMsg) Error

func (e WatcherErrMsg) Error() string

Jump to

Keyboard shortcuts

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