Help us shape the future of Go! Take the 2026 Go Developer Survey

devloop

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package devloop implements the polling file watcher behind `rastrillo dev` (design doc §11). Polling rather than a notify dependency, per the family's hand-roll-page-of-code convention (cmd/rastrillo/ modpath.go): portable, zero deps, and a 250ms poll of a small source tree sits far inside §11's ~2s save-to-serving target.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Diff

func Diff(prev, next map[string]Stamp) []string

Diff returns the sorted set of paths added, modified, or removed between two snapshots.

func Snapshot

func Snapshot(root string, dirs []string) (map[string]Stamp, error)

Snapshot fingerprints every regular file under each root/dirs entry, keyed by slash-separated path relative to root. Missing dirs are skipped, not errors: a fresh `rastrillo new` app has no app/ or manifest/ yet. Files vanishing mid-walk are skipped for the same reason — the next poll settles it.

Types

type Stamp

type Stamp struct {
	Size    int64
	ModTime time.Time
}

Stamp fingerprints one file: size plus mtime is enough to detect an edit without hashing content. Known limit: on filesystems with coarse (e.g. 1s) mtime granularity, a same-size edit landing inside the same tick as a previous stat can be missed until the next change; ext4 and APFS give mtimes nanosecond granularity, so this is a non-issue on dev machines.

Jump to

Keyboard shortcuts

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