Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotRegistered = errors.New("no workspace registered for path")
Functions ¶
This section is empty.
Types ¶
type Workspaces ¶
type Workspaces struct {
// contains filtered or unexported fields
}
func New ¶
func New(baseDir string) *Workspaces
func (*Workspaces) Init ¶
func (w *Workspaces) Init(pwd string) (string, error)
Init locks the read-modify-write so concurrent registrations cannot lose entries. pwd must be absolute and resolved.
func (*Workspaces) List ¶ added in v0.2.1
func (w *Workspaces) List(s *config.Settings) []Info
List sorts by name so CLI output is stable despite map iteration order.
func (*Workspaces) Lookup ¶
func (w *Workspaces) Lookup(s *config.Settings, pwd string) (matchedRoot, cacheDir string, err error)
Lookup returns the registered ancestor because mounting pwd would omit parent project files. Callers pass loaded settings to avoid another read. pwd must be absolute and resolved; nil settings mean no registrations.
func (*Workspaces) Remove ¶ added in v0.2.1
func (w *Workspaces) Remove(name string) (cacheDir string, err error)
Remove updates the registry under lock and returns the cache path for deletion afterward. WithLock skips Save on a miss and exposes the path computed inside the lock. The CLI replaces ErrNotRegistered's generic text.
Click to show internal directories.
Click to hide internal directories.