Documentation
¶
Index ¶
- type Adapter
- type MockAdapter
- func (m *MockAdapter) FetchOrigin(ctx context.Context) error
- func (m *MockAdapter) GetCommitHistory(ctx context.Context, baseBranch string, head string) ([]string, error)
- func (m *MockAdapter) GetDiff(ctx context.Context, branch string, exclusions []string, contextSize int, ...) (string, error)
- func (m *MockAdapter) GetDiffFromClipboard(ctx context.Context) (string, error)
- func (m *MockAdapter) GetDiffStat(ctx context.Context, branch string, exclusions []string, includePaths []string, ...) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter interface { // GetDiff fetches the git diff based on parameters GetDiff(ctx context.Context, branch string, exclusions []string, contextSize int, includePaths []string, noTests bool, noPackage bool) (string, error) // GetDiffStat fetches the git diff --stat GetDiffStat(ctx context.Context, branch string, exclusions []string, includePaths []string, noTests bool, noPackage bool) (string, error) // FetchOrigin runs `git fetch origin` FetchOrigin(ctx context.Context) error // GetDiffFromClipboard reads diff from system clipboard GetDiffFromClipboard(ctx context.Context) (string, error) // GetCommitHistory fetches commit messages from a specified range GetCommitHistory(ctx context.Context, baseBranch string, head string) ([]string, error) }
Adapter defines the interface for Git operations
type MockAdapter ¶
type MockAdapter struct { MockDiff string MockDiffStat string MockCommitMessages []string MockError error }
MockAdapter provides a mock implementation for testing
func NewMockAdapter ¶
func NewMockAdapter() *MockAdapter
NewMockAdapter creates a new mock adapter with sample data
func (*MockAdapter) FetchOrigin ¶
func (m *MockAdapter) FetchOrigin(ctx context.Context) error
FetchOrigin implements the Adapter interface
func (*MockAdapter) GetCommitHistory ¶
func (m *MockAdapter) GetCommitHistory(ctx context.Context, baseBranch string, head string) ([]string, error)
GetCommitHistory implements the Adapter interface with mock data
func (*MockAdapter) GetDiff ¶
func (m *MockAdapter) GetDiff(ctx context.Context, branch string, exclusions []string, contextSize int, includePaths []string, noTests bool, noPackage bool) (string, error)
GetDiff implements the Adapter interface with mock data
func (*MockAdapter) GetDiffFromClipboard ¶
func (m *MockAdapter) GetDiffFromClipboard(ctx context.Context) (string, error)
GetDiffFromClipboard implements the Adapter interface with mock data
Click to show internal directories.
Click to hide internal directories.