dependencies

package
v0.31.2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: GPL-3.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package dependencies provides a centralized dependency container for the CM application. This package follows Go idioms for dependency injection by grouping related dependencies together and providing a fluent API for configuration.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFSMissing                 = errors.New("fs dependency is required but not set")
	ErrGitMissing                = errors.New("git dependency is required but not set")
	ErrConfigMissing             = errors.New("config dependency is required but not set")
	ErrStatusManagerMissing      = errors.New("status manager dependency is required but not set")
	ErrLoggerMissing             = errors.New("logger dependency is required but not set")
	ErrPromptMissing             = errors.New("prompt dependency is required but not set")
	ErrHookManagerMissing        = errors.New("hook manager dependency is required but not set")
	ErrRepositoryProviderMissing = errors.New("repository provider dependency is required but not set")
	ErrWorkspaceProviderMissing  = errors.New("workspace provider dependency is required but not set")
	ErrWorktreeProviderMissing   = errors.New("worktree provider dependency is required but not set")
)

Validation errors for missing dependencies.

Functions

This section is empty.

Types

type Dependencies

type Dependencies struct {
	FS                 fs.FS
	Git                git.Git
	Config             config.Manager
	StatusManager      status.Manager
	Logger             logger.Logger
	Prompt             prompt.Prompter
	HookManager        hooks.HookManagerInterface
	RepositoryProvider repositoryinterfaces.RepositoryProvider
	WorkspaceProvider  workspaceinterfaces.WorkspaceProvider
	WorktreeProvider   worktreeinterfaces.WorktreeProvider
}

Dependencies holds shared dependencies across the application. This follows the Go idiom of grouping related data together.

func New

func New() *Dependencies

New creates a new Dependencies instance with sensible defaults. This follows Go's convention of New* functions for constructors.

func (*Dependencies) Validate

func (d *Dependencies) Validate() error

Validate checks that all required dependencies are set and returns an error if any are missing.

func (*Dependencies) WithConfig

func (d *Dependencies) WithConfig(cfg config.Manager) *Dependencies

WithConfig sets the config manager and returns the instance for chaining.

func (*Dependencies) WithFS

func (d *Dependencies) WithFS(fs fs.FS) *Dependencies

WithFS sets the filesystem and returns the instance for chaining.

func (*Dependencies) WithGit

func (d *Dependencies) WithGit(git git.Git) *Dependencies

WithGit sets the git instance and returns the instance for chaining.

func (*Dependencies) WithHookManager

func (d *Dependencies) WithHookManager(hm hooks.HookManagerInterface) *Dependencies

WithHookManager sets the hook manager and returns the instance for chaining.

func (*Dependencies) WithLogger

func (d *Dependencies) WithLogger(logger logger.Logger) *Dependencies

WithLogger sets the logger and returns the instance for chaining.

func (*Dependencies) WithPrompt

func (d *Dependencies) WithPrompt(prompt prompt.Prompter) *Dependencies

WithPrompt sets the prompt and returns the instance for chaining.

func (*Dependencies) WithRepositoryProvider

func (d *Dependencies) WithRepositoryProvider(rp repositoryinterfaces.RepositoryProvider) *Dependencies

WithRepositoryProvider sets the repository provider and returns the instance for chaining.

func (*Dependencies) WithStatusManager

func (d *Dependencies) WithStatusManager(sm status.Manager) *Dependencies

WithStatusManager sets the status manager and returns the instance for chaining.

func (*Dependencies) WithWorkspaceProvider

func (d *Dependencies) WithWorkspaceProvider(wp workspaceinterfaces.WorkspaceProvider) *Dependencies

WithWorkspaceProvider sets the workspace provider and returns the instance for chaining.

func (*Dependencies) WithWorktreeProvider

func (d *Dependencies) WithWorktreeProvider(wp worktreeinterfaces.WorktreeProvider) *Dependencies

WithWorktreeProvider sets the worktree provider and returns the instance for chaining.

Jump to

Keyboard shortcuts

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