github

package
v0.0.0-...-87e4b86 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package github provides GitHub-specific implementations of VCS interfaces

Package github provides GitHub-specific implementations of VCS interfaces

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

Adapter provides a GitHub implementation of the vcs.Service interface

func NewAdapter

func NewAdapter(cfg *config.Config) (*Adapter, error)

NewAdapter creates a new GitHub adapter

func (*Adapter) CloneRepository

func (a *Adapter) CloneRepository(owner, repo, branch string, issueNumber int) (string, error)

CloneRepository clones a GitHub repository to a local directory

func (*Adapter) CreateBranch

func (a *Adapter) CreateBranch(owner, repo, branchName, baseBranch string) error

CreateBranch creates a new branch from the specified base branch

func (*Adapter) CreateDraftPullRequest

func (a *Adapter) CreateDraftPullRequest(owner, repo, title, body, head, base string) (vcs.PullRequest, error)

CreateDraftPullRequest creates a new draft pull request

func (*Adapter) GetAssignedIssues

func (a *Adapter) GetAssignedIssues(username string, since time.Time, limit int) ([]vcs.Issue, error)

GetAssignedIssues retrieves issues assigned to a user since a specific time

func (*Adapter) GetAuthenticatedUser

func (a *Adapter) GetAuthenticatedUser() (string, error)

GetAuthenticatedUser gets the currently authenticated user

func (*Adapter) GetDefaultBranch

func (a *Adapter) GetDefaultBranch(owner, repo string) (string, error)

GetDefaultBranch gets the default branch for a repository

func (*Adapter) GetIssue

func (a *Adapter) GetIssue(owner, repo string, number int) (vcs.Issue, error)

GetIssue retrieves a basic issue without comments

func (*Adapter) GetIssueWithComments

func (a *Adapter) GetIssueWithComments(owner, repo string, number int) (vcs.Issue, error)

GetIssueWithComments retrieves an issue with all its comments

func (*Adapter) GetPullRequestsForIssue

func (a *Adapter) GetPullRequestsForIssue(owner, repo string, issueNumber int) ([]vcs.PullRequest, error)

GetPullRequestsForIssue gets all pull requests that reference an issue

func (*Adapter) GetRepositories

func (a *Adapter) GetRepositories() ([]vcs.Repository, error)

GetRepositories gets a list of repositories the authenticated user has access to

func (*Adapter) GetRepository

func (a *Adapter) GetRepository(owner, repo string) (vcs.Repository, error)

GetRepository retrieves repository information

func (*Adapter) RespondToIssue

func (a *Adapter) RespondToIssue(owner, repo string, issueNumber int, comment string) error

RespondToIssue posts a comment on a GitHub issue

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client handles GitHub API interactions

func NewClient

func NewClient(token string) *Client

NewClient creates a new GitHub client

func (*Client) CloneRepository

func (c *Client) CloneRepository(owner, repo, branch string, issueNumber int) (string, error)

CloneRepository clones a GitHub repository to a local directory

func (*Client) CreateBranch

func (c *Client) CreateBranch(owner, repo, branchName, baseBranch string) error

CreateBranch creates a new branch from the specified base branch

func (*Client) CreateImplementationFile

func (c *Client) CreateImplementationFile(owner, repo, branchName string, issueNumber int) error

CreateImplementationFile creates an implementation plan as developer instructions and passes it to the CLI tool

func (*Client) GetIssueComments

func (c *Client) GetIssueComments(owner, repo string, issueNumber int) ([]*github.IssueComment, error)

GetIssueComments gets comments for an issue

func (*Client) GetIssueDetails

func (c *Client) GetIssueDetails(owner, repo string, number int) (*models.Issue, error)

GetIssueDetails retrieves full details of an issue including comments

func (*Client) GetIssues

func (c *Client) GetIssues(owner, repo string) ([]*github.Issue, error)

GetIssues gets issues for a repository

func (*Client) GetPullRequestsForIssue

func (c *Client) GetPullRequestsForIssue(owner, repo string, issueNumber int) ([]*github.PullRequest, error)

GetPullRequestsForIssue gets all pull requests that reference an issue

func (*Client) GetRepositories

func (c *Client) GetRepositories() ([]*github.Repository, error)

GetRepositories gets a list of repositories the authenticated user has access to

func (*Client) GetUserInfo

func (c *Client) GetUserInfo() (*github.User, error)

GetUserInfo gets information about the authenticated user

func (*Client) RespondToIssue

func (c *Client) RespondToIssue(owner, repo string, issueNumber int, comment string) error

RespondToIssue posts a comment on a GitHub issue

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider implements vcs.ServiceProvider for GitHub

func NewProvider

func NewProvider(cfg *config.Config) *Provider

NewProvider creates a new GitHub service provider

func (*Provider) GetService

func (p *Provider) GetService() vcs.Service

GetService returns a GitHub implementation of vcs.Service

Jump to

Keyboard shortcuts

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