interfaces

package
v0.27.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2025 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package interfaces defines the repository interface for dependency injection. This package is separate to avoid circular imports.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateWorktreeOpts

type CreateWorktreeOpts struct {
	IDEName       string
	IssueInfo     *issue.Info
	WorkspaceName string
	Remote        string // Remote name to use (defaults to DefaultRemote if empty)
}

CreateWorktreeOpts contains optional parameters for worktree creation in repository mode.

type LoadWorktreeOpts

type LoadWorktreeOpts struct {
	IssueInfo *issue.Info
}

LoadWorktreeOpts contains optional parameters for LoadWorktree.

type NewRepositoryParams

type NewRepositoryParams struct {
	Dependencies   interface{} // *dependencies.Dependencies
	RepositoryName string      // Name/Path of the repository (optional, defaults to current directory)
}

NewRepositoryParams contains parameters for creating a new Repository instance.

type Repository

type Repository interface {
	Validate() error
	CreateWorktree(branch string, opts ...CreateWorktreeOpts) (string, error)
	DeleteWorktree(branch string, force bool) error
	DeleteAllWorktrees(force bool) error
	ListWorktrees() ([]status.WorktreeInfo, error)
	LoadWorktree(remoteSource, branchName string) (string, error)
	IsGitRepository() (bool, error)
	ValidateGitConfiguration(workDir string) error
	ValidateGitStatus() error
	ValidateRepository(params ValidationParams) (*ValidationResult, error)
	ValidateWorktreeExists(repoURL, branch string) error
	ValidateOriginRemote() error
	HandleRemoteManagement(repoURL string) error
	ExtractHostFromURL(url string) string
	DetermineProtocol(url string) string
	ExtractRepoNameFromFullPath(fullPath string) string
	ConstructRemoteURL(originURL, remoteSource, repoName string) (string, error)
	AddWorktreeToStatus(params StatusParams) error
	AutoAddRepositoryToStatus(repoURL, repoPath string) error
}

Repository defines the interface for repository operations. This interface is implemented by the concrete repository types.

type RepositoryProvider

type RepositoryProvider func(params NewRepositoryParams) Repository

RepositoryProvider defines the function signature for creating repository instances.

type StatusParams

type StatusParams struct {
	RepoURL       string
	Branch        string
	WorktreePath  string
	WorkspacePath string
	Remote        string
	IssueInfo     *issue.Info
}

StatusParams contains parameters for status operations.

type ValidationParams

type ValidationParams struct {
	CurrentDir string
	Branch     string
}

ValidationParams contains parameters for repository validation.

type ValidationResult

type ValidationResult struct {
	RepoURL  string
	RepoPath string
}

ValidationResult contains the result of repository validation.

Jump to

Keyboard shortcuts

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