Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileChange ¶
FileChange represents a single file changed in the snapshot.
func (FileChange) StatusSymbol ¶
func (f FileChange) StatusSymbol() string
StatusSymbol returns a human-readable symbol for the file change status.
type Region ¶
type Region struct {
// contains filtered or unexported fields
}
Region is a named section of a Screen that can be independently updated. All methods are safe for concurrent use.
func (*Region) AppendLine ¶
AppendLine adds a line to this region and redraws from this region downward.
type Screen ¶
type Screen struct {
// contains filtered or unexported fields
}
Screen manages multiple named regions on a terminal, each independently rewritable. Regions are rendered top-to-bottom in insertion order.
Usage:
s := NewScreen(os.Stdout)
completed := s.AddRegion("completed")
jobs := s.AddRegion("jobs")
status := s.AddRegion("status")
jobs.SetLines([]string{" ● lint running", " ● test running"})
status.SetLines([]string{" ⠋ Watching…"})
// Promote a completed job:
completed.AppendLine(" ✓ lint passed")
// Update active jobs:
jobs.SetLines([]string{" ● test running"})
type SnapshotOption ¶
type SnapshotOption func(*snapshotConfig)
SnapshotOption configures Snapshot behavior.
type SnapshotResult ¶
type SnapshotResult struct {
Commit string
Ref string
Branch string
Files []FileChange
}
SnapshotResult holds the output of a successful snapshot operation.
func Snapshot ¶
func Snapshot(dir string, preflightID uuid.UUID, opts ...SnapshotOption) (*SnapshotResult, error)
Snapshot pushes the current working tree state to a remote preflight ref. If there are uncommitted changes, it creates a temporary commit containing them without touching the real git index. If the worktree is clean, it pushes HEAD directly.