Documentation
¶
Overview ¶
Package vcs provides interfaces and implementations for version control system interactions
Package vcs provides interfaces and implementations for version control system interactions ¶
Package vcs provides interfaces and implementations for version control system interactions ¶
Package vcs provides interfaces and implementations for version control system interactions ¶
Package vcs provides interfaces and implementations for version control system interactions ¶
Package vcs provides interfaces and implementations for version control system interactions ¶
Package vcs provides interfaces and implementations for version control system interactions
Index ¶
- type BaseIssue
- func (i *BaseIssue) GetAssignees() []string
- func (i *BaseIssue) GetBody() string
- func (i *BaseIssue) GetComments() []IssueComment
- func (i *BaseIssue) GetCreatedAt() time.Time
- func (i *BaseIssue) GetLabels() []string
- func (i *BaseIssue) GetNumber() int
- func (i *BaseIssue) GetOwner() string
- func (i *BaseIssue) GetRepo() string
- func (i *BaseIssue) GetState() string
- func (i *BaseIssue) GetTitle() string
- func (i *BaseIssue) GetURL() string
- func (i *BaseIssue) GetUpdatedAt() time.Time
- func (i *BaseIssue) GetUser() string
- type BasePullRequest
- func (p *BasePullRequest) GetBaseBranch() string
- func (p *BasePullRequest) GetBody() string
- func (p *BasePullRequest) GetHeadBranch() string
- func (p *BasePullRequest) GetIsDraft() bool
- func (p *BasePullRequest) GetNumber() int
- func (p *BasePullRequest) GetState() string
- func (p *BasePullRequest) GetTitle() string
- func (p *BasePullRequest) GetURL() string
- func (p *BasePullRequest) GetUser() string
- type BaseRepository
- func (r *BaseRepository) GetDefaultBranch() string
- func (r *BaseRepository) GetDescription() string
- func (r *BaseRepository) GetForksCount() int
- func (r *BaseRepository) GetHasIssues() bool
- func (r *BaseRepository) GetName() string
- func (r *BaseRepository) GetOwner() string
- func (r *BaseRepository) GetStargazersCount() int
- func (r *BaseRepository) GetURL() string
- type Factory
- type Issue
- type IssueComment
- type IssueProcessor
- type Monitor
- type MonitorConfig
- type Provider
- type PullRequest
- type Repository
- type Service
- type ServiceProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseIssue ¶
type BaseIssue struct {
Owner string
Repo string
Number int
Title string
Body string
User string
State string
CreatedAt time.Time
UpdatedAt time.Time
URL string
Comments []IssueComment
Labels []string
Assignees []string
}
BaseIssue provides a common implementation of Issue
func (*BaseIssue) GetAssignees ¶
GetAssignees returns usernames of people assigned to the issue
func (*BaseIssue) GetComments ¶
func (i *BaseIssue) GetComments() []IssueComment
GetComments returns the issue comments
func (*BaseIssue) GetCreatedAt ¶
GetCreatedAt returns the issue creation timestamp
func (*BaseIssue) GetUpdatedAt ¶
GetUpdatedAt returns when the issue was last updated
type BasePullRequest ¶
type BasePullRequest struct {
Number int
Title string
Body string
State string
IsDraft bool
User string
HeadBranch string
BaseBranch string
URL string
}
BasePullRequest provides a common implementation of PullRequest
func (*BasePullRequest) GetBaseBranch ¶
func (p *BasePullRequest) GetBaseBranch() string
GetBaseBranch returns the base branch
func (*BasePullRequest) GetBody ¶
func (p *BasePullRequest) GetBody() string
GetBody returns the PR body
func (*BasePullRequest) GetHeadBranch ¶
func (p *BasePullRequest) GetHeadBranch() string
GetHeadBranch returns the head branch
func (*BasePullRequest) GetIsDraft ¶
func (p *BasePullRequest) GetIsDraft() bool
GetIsDraft returns whether the PR is a draft
func (*BasePullRequest) GetNumber ¶
func (p *BasePullRequest) GetNumber() int
GetNumber returns the PR number
func (*BasePullRequest) GetState ¶
func (p *BasePullRequest) GetState() string
GetState returns the PR state (open/closed/merged)
func (*BasePullRequest) GetTitle ¶
func (p *BasePullRequest) GetTitle() string
GetTitle returns the PR title
func (*BasePullRequest) GetURL ¶
func (p *BasePullRequest) GetURL() string
GetURL returns the PR URL
func (*BasePullRequest) GetUser ¶
func (p *BasePullRequest) GetUser() string
GetUser returns the username of the PR creator
type BaseRepository ¶
type BaseRepository struct {
Owner string
Name string
DefaultBranch string
URL string
Description string
HasIssues bool
StargazersCount int
ForksCount int
}
BaseRepository provides a common implementation of Repository
func (*BaseRepository) GetDefaultBranch ¶
func (r *BaseRepository) GetDefaultBranch() string
GetDefaultBranch returns the default branch name
func (*BaseRepository) GetDescription ¶
func (r *BaseRepository) GetDescription() string
GetDescription returns the repository description
func (*BaseRepository) GetForksCount ¶
func (r *BaseRepository) GetForksCount() int
GetForksCount returns the number of forks
func (*BaseRepository) GetHasIssues ¶
func (r *BaseRepository) GetHasIssues() bool
GetHasIssues returns whether the repository has issues enabled
func (*BaseRepository) GetName ¶
func (r *BaseRepository) GetName() string
GetName returns the repository name
func (*BaseRepository) GetOwner ¶
func (r *BaseRepository) GetOwner() string
GetOwner returns the repository owner
func (*BaseRepository) GetStargazersCount ¶
func (r *BaseRepository) GetStargazersCount() int
GetStargazersCount returns the number of stars
func (*BaseRepository) GetURL ¶
func (r *BaseRepository) GetURL() string
GetURL returns the repository URL
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory creates VCS service providers based on platform
func (*Factory) GetService ¶
GetService is a convenience method to get a Service directly
func (*Factory) GetServiceProvider ¶
func (f *Factory) GetServiceProvider() (ServiceProvider, error)
GetServiceProvider returns the appropriate service provider based on configuration
func (*Factory) RegisterProvider ¶
func (f *Factory) RegisterProvider(platform string, creator func(*config.Config) ServiceProvider)
RegisterProvider registers a provider creator function for a platform
type Issue ¶
type Issue interface {
GetOwner() string
GetRepo() string
GetNumber() int
GetTitle() string
GetBody() string
GetUser() string
GetState() string
GetCreatedAt() time.Time
GetUpdatedAt() time.Time
GetURL() string
GetComments() []IssueComment
GetLabels() []string
GetAssignees() []string
}
Issue represents a generic issue across VCS platforms
type IssueComment ¶
IssueComment represents a comment on an issue
type IssueProcessor ¶
IssueProcessor defines a function that processes a single issue
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor provides a generic VCS monitor for any platform
func NewMonitor ¶
func NewMonitor(cfg MonitorConfig) (*Monitor, error)
NewMonitor creates a new VCS monitor with the given configuration
func (*Monitor) GetUsername ¶
GetUsername returns the username being used for monitoring
type MonitorConfig ¶
type MonitorConfig struct {
Config *config.Config
Service Service
Processor IssueProcessor
}
MonitorConfig holds configuration for creating a monitor
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider creates VCS services based on configuration
func NewProvider ¶
NewProvider creates a new service provider
func (*Provider) GetService ¶
GetService returns the appropriate service based on configuration
type PullRequest ¶
type PullRequest interface {
GetNumber() int
GetTitle() string
GetBody() string
GetState() string
GetIsDraft() bool
GetUser() string
GetHeadBranch() string
GetBaseBranch() string
GetURL() string
}
PullRequest represents a generic pull request across VCS platforms
type Repository ¶
type Repository interface {
GetOwner() string
GetName() string
GetDefaultBranch() string
GetURL() string
GetDescription() string
GetHasIssues() bool
GetStargazersCount() int
GetForksCount() int
}
Repository represents a generic repository across VCS platforms
type Service ¶
type Service interface {
// Issue operations
GetIssue(owner, repo string, number int) (Issue, error)
GetIssueWithComments(owner, repo string, number int) (Issue, error)
GetAssignedIssues(username string, since time.Time, limit int) ([]Issue, error)
RespondToIssue(owner, repo string, issueNumber int, comment string) error
// Repository operations
GetRepository(owner, repo string) (Repository, error)
GetDefaultBranch(owner, repo string) (string, error)
CloneRepository(owner, repo, branch string, number int) (string, error)
GetRepositories() ([]Repository, error) // Get all accessible repositories for the authenticated user
// Branch operations
CreateBranch(owner, repo, branchName, baseBranch string) error
// PR operations
CreateDraftPullRequest(owner, repo, title, body, head, base string) (PullRequest, error)
GetPullRequestsForIssue(owner, repo string, issueNumber int) ([]PullRequest, error)
// Authentication
GetAuthenticatedUser() (string, error)
}
Service defines the common interface for all VCS providers (GitHub, GitLab, etc.)
type ServiceProvider ¶
type ServiceProvider interface {
GetService() Service
}
ServiceProvider creates VCS service instances