Documentation
¶
Overview ¶
Package status provides status management functionality and error definitions.
Package status is a generated GoMock package.
Index ¶
- Variables
- type AddRepositoryParams
- type AddWorkspaceParams
- type AddWorktreeParams
- type Manager
- type MockManager
- func (m *MockManager) AddRepository(repoURL string, params AddRepositoryParams) error
- func (m *MockManager) AddWorkspace(workspacePath string, params AddWorkspaceParams) error
- func (m *MockManager) AddWorktree(params AddWorktreeParams) error
- func (m *MockManager) CreateInitialStatus() error
- func (m *MockManager) EXPECT() *MockManagerMockRecorder
- func (m *MockManager) GetRepository(repoURL string) (*Repository, error)
- func (m *MockManager) GetWorkspace(workspacePath string) (*Workspace, error)
- func (m *MockManager) GetWorkspaceBranches(workspacePath string) ([]string, error)
- func (m *MockManager) GetWorkspaceWorktrees(workspacePath, branchName string) ([]WorktreeInfo, error)
- func (m *MockManager) GetWorktree(repoURL, branch string) (*WorktreeInfo, error)
- func (m *MockManager) ListAllWorktrees() ([]WorktreeInfo, error)
- func (m *MockManager) ListRepositories() (map[string]Repository, error)
- func (m *MockManager) ListWorkspaces() (map[string]Workspace, error)
- func (m *MockManager) RemoveWorktree(repoURL, branch string) error
- type MockManagerMockRecorder
- func (mr *MockManagerMockRecorder) AddRepository(repoURL, params any) *gomock.Call
- func (mr *MockManagerMockRecorder) AddWorkspace(workspacePath, params any) *gomock.Call
- func (mr *MockManagerMockRecorder) AddWorktree(params any) *gomock.Call
- func (mr *MockManagerMockRecorder) CreateInitialStatus() *gomock.Call
- func (mr *MockManagerMockRecorder) GetRepository(repoURL any) *gomock.Call
- func (mr *MockManagerMockRecorder) GetWorkspace(workspacePath any) *gomock.Call
- func (mr *MockManagerMockRecorder) GetWorkspaceBranches(workspacePath any) *gomock.Call
- func (mr *MockManagerMockRecorder) GetWorkspaceWorktrees(workspacePath, branchName any) *gomock.Call
- func (mr *MockManagerMockRecorder) GetWorktree(repoURL, branch any) *gomock.Call
- func (mr *MockManagerMockRecorder) ListAllWorktrees() *gomock.Call
- func (mr *MockManagerMockRecorder) ListRepositories() *gomock.Call
- func (mr *MockManagerMockRecorder) ListWorkspaces() *gomock.Call
- func (mr *MockManagerMockRecorder) RemoveWorktree(repoURL, branch any) *gomock.Call
- type Remote
- type Repository
- type Status
- type Workspace
- type WorktreeInfo
Constants ¶
This section is empty.
Variables ¶
var ( // Worktree management errors. ErrWorktreeAlreadyExists = errors.New("worktree already exists") ErrWorktreeNotFound = errors.New("worktree not found") ErrConfigurationNotInitialized = errors.New("configuration is not initialized") ErrNotInitialized = errors.New("CM is not initialized. Run 'cm init' to initialize") // Repository management errors. ErrRepositoryNotFound = errors.New("repository not found in status") ErrRepositoryAlreadyExists = errors.New("repository already exists") // Workspace management errors. ErrWorkspaceNotFound = errors.New("workspace not found in status") ErrWorkspaceAlreadyExists = errors.New("workspace already exists") )
Error definitions for status package.
Functions ¶
This section is empty.
Types ¶
type AddRepositoryParams ¶
AddRepositoryParams contains parameters for AddRepository.
type AddWorkspaceParams ¶
AddWorkspaceParams contains parameters for AddWorkspace.
type AddWorktreeParams ¶
type AddWorktreeParams struct {
RepoURL string
Branch string
WorktreePath string
WorkspacePath string
IssueInfo *issue.Info
Remote string
}
AddWorktreeParams contains parameters for AddWorktree.
type Manager ¶
type Manager interface {
// AddWorktree adds a worktree entry to the status file.
AddWorktree(params AddWorktreeParams) error
// RemoveWorktree removes a worktree entry from the status file.
RemoveWorktree(repoURL, branch string) error
// GetWorktree retrieves the status of a specific worktree.
GetWorktree(repoURL, branch string) (*WorktreeInfo, error)
// ListAllWorktrees lists all tracked worktrees.
ListAllWorktrees() ([]WorktreeInfo, error)
// GetWorkspaceWorktrees returns all worktrees for a specific workspace and branch.
GetWorkspaceWorktrees(workspacePath, branchName string) ([]WorktreeInfo, error)
// GetWorkspaceBranches returns all branch names for a specific workspace.
GetWorkspaceBranches(workspacePath string) ([]string, error)
// CreateInitialStatus creates the initial status file structure.
CreateInitialStatus() error
// AddRepository adds a repository entry to the status file.
AddRepository(repoURL string, params AddRepositoryParams) error
// GetRepository retrieves a repository entry from the status file.
GetRepository(repoURL string) (*Repository, error)
// ListRepositories lists all repositories in the status file.
ListRepositories() (map[string]Repository, error)
// AddWorkspace adds a workspace entry to the status file.
AddWorkspace(workspacePath string, params AddWorkspaceParams) error
// GetWorkspace retrieves a workspace entry from the status file.
GetWorkspace(workspacePath string) (*Workspace, error)
// ListWorkspaces lists all workspaces in the status file.
ListWorkspaces() (map[string]Workspace, error)
}
Manager interface provides status file management functionality.
type MockManager ¶
type MockManager struct {
// contains filtered or unexported fields
}
MockManager is a mock of Manager interface.
func NewMockManager ¶
func NewMockManager(ctrl *gomock.Controller) *MockManager
NewMockManager creates a new mock instance.
func (*MockManager) AddRepository ¶
func (m *MockManager) AddRepository(repoURL string, params AddRepositoryParams) error
AddRepository mocks base method.
func (*MockManager) AddWorkspace ¶
func (m *MockManager) AddWorkspace(workspacePath string, params AddWorkspaceParams) error
AddWorkspace mocks base method.
func (*MockManager) AddWorktree ¶
func (m *MockManager) AddWorktree(params AddWorktreeParams) error
AddWorktree mocks base method.
func (*MockManager) CreateInitialStatus ¶
func (m *MockManager) CreateInitialStatus() error
CreateInitialStatus mocks base method.
func (*MockManager) EXPECT ¶
func (m *MockManager) EXPECT() *MockManagerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockManager) GetRepository ¶
func (m *MockManager) GetRepository(repoURL string) (*Repository, error)
GetRepository mocks base method.
func (*MockManager) GetWorkspace ¶
func (m *MockManager) GetWorkspace(workspacePath string) (*Workspace, error)
GetWorkspace mocks base method.
func (*MockManager) GetWorkspaceBranches ¶
func (m *MockManager) GetWorkspaceBranches(workspacePath string) ([]string, error)
GetWorkspaceBranches mocks base method.
func (*MockManager) GetWorkspaceWorktrees ¶
func (m *MockManager) GetWorkspaceWorktrees(workspacePath, branchName string) ([]WorktreeInfo, error)
GetWorkspaceWorktrees mocks base method.
func (*MockManager) GetWorktree ¶
func (m *MockManager) GetWorktree(repoURL, branch string) (*WorktreeInfo, error)
GetWorktree mocks base method.
func (*MockManager) ListAllWorktrees ¶
func (m *MockManager) ListAllWorktrees() ([]WorktreeInfo, error)
ListAllWorktrees mocks base method.
func (*MockManager) ListRepositories ¶
func (m *MockManager) ListRepositories() (map[string]Repository, error)
ListRepositories mocks base method.
func (*MockManager) ListWorkspaces ¶
func (m *MockManager) ListWorkspaces() (map[string]Workspace, error)
ListWorkspaces mocks base method.
func (*MockManager) RemoveWorktree ¶
func (m *MockManager) RemoveWorktree(repoURL, branch string) error
RemoveWorktree mocks base method.
type MockManagerMockRecorder ¶
type MockManagerMockRecorder struct {
// contains filtered or unexported fields
}
MockManagerMockRecorder is the mock recorder for MockManager.
func (*MockManagerMockRecorder) AddRepository ¶
func (mr *MockManagerMockRecorder) AddRepository(repoURL, params any) *gomock.Call
AddRepository indicates an expected call of AddRepository.
func (*MockManagerMockRecorder) AddWorkspace ¶
func (mr *MockManagerMockRecorder) AddWorkspace(workspacePath, params any) *gomock.Call
AddWorkspace indicates an expected call of AddWorkspace.
func (*MockManagerMockRecorder) AddWorktree ¶
func (mr *MockManagerMockRecorder) AddWorktree(params any) *gomock.Call
AddWorktree indicates an expected call of AddWorktree.
func (*MockManagerMockRecorder) CreateInitialStatus ¶
func (mr *MockManagerMockRecorder) CreateInitialStatus() *gomock.Call
CreateInitialStatus indicates an expected call of CreateInitialStatus.
func (*MockManagerMockRecorder) GetRepository ¶
func (mr *MockManagerMockRecorder) GetRepository(repoURL any) *gomock.Call
GetRepository indicates an expected call of GetRepository.
func (*MockManagerMockRecorder) GetWorkspace ¶
func (mr *MockManagerMockRecorder) GetWorkspace(workspacePath any) *gomock.Call
GetWorkspace indicates an expected call of GetWorkspace.
func (*MockManagerMockRecorder) GetWorkspaceBranches ¶
func (mr *MockManagerMockRecorder) GetWorkspaceBranches(workspacePath any) *gomock.Call
GetWorkspaceBranches indicates an expected call of GetWorkspaceBranches.
func (*MockManagerMockRecorder) GetWorkspaceWorktrees ¶
func (mr *MockManagerMockRecorder) GetWorkspaceWorktrees(workspacePath, branchName any) *gomock.Call
GetWorkspaceWorktrees indicates an expected call of GetWorkspaceWorktrees.
func (*MockManagerMockRecorder) GetWorktree ¶
func (mr *MockManagerMockRecorder) GetWorktree(repoURL, branch any) *gomock.Call
GetWorktree indicates an expected call of GetWorktree.
func (*MockManagerMockRecorder) ListAllWorktrees ¶
func (mr *MockManagerMockRecorder) ListAllWorktrees() *gomock.Call
ListAllWorktrees indicates an expected call of ListAllWorktrees.
func (*MockManagerMockRecorder) ListRepositories ¶
func (mr *MockManagerMockRecorder) ListRepositories() *gomock.Call
ListRepositories indicates an expected call of ListRepositories.
func (*MockManagerMockRecorder) ListWorkspaces ¶
func (mr *MockManagerMockRecorder) ListWorkspaces() *gomock.Call
ListWorkspaces indicates an expected call of ListWorkspaces.
func (*MockManagerMockRecorder) RemoveWorktree ¶
func (mr *MockManagerMockRecorder) RemoveWorktree(repoURL, branch any) *gomock.Call
RemoveWorktree indicates an expected call of RemoveWorktree.
type Remote ¶
type Remote struct {
DefaultBranch string `yaml:"default_branch"`
}
Remote represents a remote configuration for a repository.
type Repository ¶
type Repository struct {
Path string `yaml:"path"`
Remotes map[string]Remote `yaml:"remotes"`
Worktrees map[string]WorktreeInfo `yaml:"worktrees"`
}
Repository represents a repository entry in the status file.
type Status ¶
type Status struct {
Repositories map[string]Repository `yaml:"repositories"`
Workspaces map[string]Workspace `yaml:"workspaces"`
}
Status represents the status.yaml file structure.