workspace

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RepoInfo

type RepoInfo struct {
	config.ResolvedRepo
	AbsPath string
	Driver  vcs.Driver
	Exists  bool
}

RepoInfo holds resolved repo info with its driver.

type Selector

type Selector struct {
	Include []string
	Exclude []string
}

Selector filters repos by inclusion/exclusion lists.

func NewSelector

func NewSelector(include, exclude string) *Selector

NewSelector creates a selector from comma-separated repo name strings.

func (*Selector) IsEmpty

func (s *Selector) IsEmpty() bool

IsEmpty returns true if the selector has no filters.

func (*Selector) Matches

func (s *Selector) Matches(name string) bool

Matches returns true if the given repo name passes the filter.

type Workspace

type Workspace struct {
	Root   string
	Config *config.Config
	Repos  []RepoInfo
}

Workspace represents a loaded mit workspace.

func Load

func Load(dir string) (*Workspace, error)

Load loads a workspace from the given directory (or any child directory).

func (*Workspace) EnsureDriver

func (ws *Workspace) EnsureDriver(ctx context.Context, repo *RepoInfo, defaultVCS string) (vcs.Driver, error)

EnsureDriver returns the repo's VCS driver, or detects/creates one.

func (*Workspace) FilterRepos

func (ws *Workspace) FilterRepos(sel *Selector) []RepoInfo

FilterRepos filters the workspace repos using the selector.

func (*Workspace) GetRepo

func (ws *Workspace) GetRepo(name string) (*RepoInfo, error)

GetRepo returns a single repo by name.

func (*Workspace) RepoNames

func (ws *Workspace) RepoNames() []string

RepoNames returns the names of all repos.

Jump to

Keyboard shortcuts

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