Versions in this module Expand all Collapse all v1 v1.3.0 May 16, 2025 Changes in this version + func IsRepository(path string) (bool, error) + type CommandExecutor interface + Execute func(ctx context.Context, cmd *exec.Cmd) error + ExecuteWithContext func(ctx context.Context, name string, args ...string) error + ExecuteWithContextAndOutput func(ctx context.Context, name string, args ...string) (string, error) + ExecuteWithOutput func(ctx context.Context, cmd *exec.Cmd) (string, error) + type DefaultInteractor struct + Logger logger.Logger + Reader io.Reader + Writer io.Writer + func NewDefaultInteractor(logger logger.Logger) *DefaultInteractor + func (i *DefaultInteractor) PromptYesNo(question string) bool + type ExecExecutor struct + func NewExecExecutor() *ExecExecutor + func (e *ExecExecutor) Execute(ctx context.Context, cmd *exec.Cmd) error + func (e *ExecExecutor) ExecuteWithContext(ctx context.Context, name string, args ...string) error + func (e *ExecExecutor) ExecuteWithContextAndOutput(ctx context.Context, name string, args ...string) (string, error) + func (e *ExecExecutor) ExecuteWithOutput(ctx context.Context, cmd *exec.Cmd) (string, error) + type Gitbak struct + func NewGitbak(config GitbakConfig, logger logger.Logger) (*Gitbak, error) + func NewGitbakWithDeps(config GitbakConfig, logger logger.Logger, executor CommandExecutor, ...) (*Gitbak, error) + func (g *Gitbak) PrintSummary() + func (g *Gitbak) Run(ctx context.Context) error + func (g *Gitbak) RunSingleIteration(ctx context.Context) error + type GitbakConfig struct + BranchName string + CommitPrefix string + ContinueSession bool + CreateBranch bool + IntervalMinutes float64 + MaxRetries int + NonInteractive bool + RepoPath string + ShowNoChanges bool + Verbose bool + func (c *GitbakConfig) Validate() error + type MockCommandExecutor struct + AddCalled bool + AddError bool + CallCount int + Commands []*exec.Cmd + CommitCalled bool + CommitError bool + CurrentErr error + ErrorVariant int + ExecuteFn func(ctx context.Context, cmd *exec.Cmd) error + ExecuteWithOutputFn func(ctx context.Context, cmd *exec.Cmd) (string, error) + ExitCode int + FailWithErr error + LastCmd *exec.Cmd + NextFailCall chan struct{} + NextSuccessCall chan struct{} + Output string + PermanentFailAfter int + ShouldFailCount int + ShouldResetErrorMsg bool + UseAdvancedRetryBehavior bool + func NewAdvancedMockRetryExecutor(failCount int, failWithErr error) *MockCommandExecutor + func NewMockCommandExecutor() *MockCommandExecutor + func NewMockRetryExecutor(failCount int, failWithErr error) *MockCommandExecutor + func NewMockUncommittedChangesExecutor(addError, commitError bool) *MockCommandExecutor + func (m *MockCommandExecutor) Execute(ctx context.Context, cmd *exec.Cmd) error + func (m *MockCommandExecutor) ExecuteWithContext(ctx context.Context, name string, args ...string) error + func (m *MockCommandExecutor) ExecuteWithContextAndOutput(ctx context.Context, name string, args ...string) (string, error) + func (m *MockCommandExecutor) ExecuteWithOutput(ctx context.Context, cmd *exec.Cmd) (string, error) + type MockInteractor struct + LastPrompt string + PromptYesNoCalled bool + PromptYesNoResponse bool + func NewMockInteractor(response bool) *MockInteractor + func (m *MockInteractor) PromptYesNo(prompt string) bool + type NonInteractiveInteractor struct + func NewNonInteractiveInteractor() *NonInteractiveInteractor + func (i *NonInteractiveInteractor) PromptYesNo(question string) bool + type UserInteractor interface + PromptYesNo func(question string) bool