workspace

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 9 Imported by: 0

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 Info added in v0.2.1

type Info struct {
	Name      string
	Path      string
	CreatedAt time.Time
}

Info joins the registry path key with its stored fields for display.

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.

Jump to

Keyboard shortcuts

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