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

watch

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = NewCommand()

Cmd represents the watch command.

Functions

func NewCommand

func NewCommand() *cobra.Command

NewCommand returns a new watch command instance.

Types

type RepoLock added in v0.33.0

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

RepoLock is the exclusive advisory lock that gates persistence and serving to a single clarity watch process per repository (see CLR-91). It is held for the lifetime of the process; the OS releases it automatically on exit, including a crash, so there is no stale-lock/PID-liveness bookkeeping to build or recover.

func AcquireRepoLock added in v0.33.0

func AcquireRepoLock(worktreePath string) (*RepoLock, *lockInfo, error)

AcquireRepoLock tries to become the sole clarity watch process for the repository containing worktreePath. On success it returns the held lock, ready for SetServing once the port is known, and a nil lockInfo. If another process already holds it, it returns a nil *RepoLock and that process's last recorded lockInfo instead.

func (*RepoLock) Release added in v0.33.0

func (l *RepoLock) Release() error

Release releases the lock. The file itself is left in place — its content goes stale but is harmless, and the next holder overwrites it via SetServing.

func (*RepoLock) SetServing added in v0.33.0

func (l *RepoLock) SetServing(port int) error

SetServing records the port this process is serving on, so a process that loses the lock race can point the user at it instead of starting a competing instance.

Directories

Path Synopsis
Package store persists clarity watch's session history (projects, worktrees, sessions, commits, snapshots) to a per-repo SQLite database, so it survives a process restart or crash.
Package store persists clarity watch's session history (projects, worktrees, sessions, commits, snapshots) to a per-repo SQLite database, so it survives a process restart or crash.

Jump to

Keyboard shortcuts

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