watcher

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 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 Hub

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

Hub manages per-directory file watchers and fans out change notifications to subscribers keyed by file path.

func NewHub

func NewHub() *Hub

func (*Hub) Close

func (h *Hub) Close()

func (*Hub) Subscribe

func (h *Hub) Subscribe(filePath string) chan struct{}

Subscribe creates a channel that receives notifications when the given file changes. The caller must call Unsubscribe when done.

func (*Hub) Unsubscribe

func (h *Hub) Unsubscribe(filePath string, ch chan struct{})

Unsubscribe removes a subscriber channel for the given file path.

Jump to

Keyboard shortcuts

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