Documentation
¶
Index ¶
- func ExchangeToken(ctx context.Context, cfg *oauth2.Config, code string) (*oauth2.Token, error)
- func OAuthConfig(clientID, clientSecret, redirectURL string, scopes []string) *oauth2.Config
- type Client
- func (c *Client) AddLabels(ctx context.Context, owner, repo string, number int, labels []string) ([]*githubapi.Label, error)
- func (c *Client) CommitMultipleFiles(ctx context.Context, owner, repo, branch, message string, ...) (*githubapi.Commit, error)
- func (c *Client) CreateBranch(ctx context.Context, owner, repo, branchName, baseBranch string) (*githubapi.Reference, error)
- func (c *Client) CreateComment(ctx context.Context, owner, repo string, number int, comment string) (*githubapi.IssueComment, error)
- func (c *Client) CreateFromTemplate(ctx context.Context, tmplOwner, tmplRepo, newName, owner string) (*githubapi.Repository, error)
- func (c *Client) CreateIssue(ctx context.Context, owner, repo, title, body string) (*githubapi.Issue, error)
- func (c *Client) CreatePullRequest(ctx context.Context, owner, repo, title, head, base, body string) (*githubapi.PullRequest, error)
- func (c *Client) CreateRepository(ctx context.Context, name, description string, private bool) (*githubapi.Repository, error)
- func (c *Client) GetFileContent(ctx context.Context, owner, repo, path, ref string) (string, *githubapi.RepositoryContent, error)
- func (c *Client) GetInstallation(ctx context.Context, installationID int64) (*githubapi.Installation, error)
- func (c *Client) ListBranches(ctx context.Context, owner, repo string) ([]*githubapi.Branch, error)
- func (c *Client) ListCommits(ctx context.Context, owner, repo string, opts *githubapi.CommitsListOptions) ([]*githubapi.RepositoryCommit, error)
- func (c *Client) ListIssues(ctx context.Context, owner, repo string, ...) ([]*githubapi.Issue, error)
- func (c *Client) ListPullRequests(ctx context.Context, owner, repo string, ...) ([]*githubapi.PullRequest, error)
- func (c *Client) ListRepositories(ctx context.Context) ([]*githubapi.Repository, error)
- func (c *Client) MergePullRequest(ctx context.Context, owner, repo string, number int, commitMessage string) (*githubapi.PullRequestMergeResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExchangeToken ¶
ExchangeToken exchanges the oauth2 code for a token
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps a go-github client for unified api operations
func NewClientFromApp ¶
func NewClientFromApp(ctx context.Context, appID, installID int64, privateKeyPEM []byte) (*Client, error)
NewClientFromApp creates a client using a gitHub app installation privateKeyPEM may be raw or base64-encoded PEM
func NewClientFromToken ¶
NewClientFromToken creates a client using an oauth2 token
func (*Client) AddLabels ¶
func (c *Client) AddLabels(ctx context.Context, owner, repo string, number int, labels []string) ([]*githubapi.Label, error)
AddLabels adds labels to an issue or pr
func (*Client) CommitMultipleFiles ¶
func (c *Client) CommitMultipleFiles(ctx context.Context, owner, repo, branch, message string, files map[string][]byte) (*githubapi.Commit, error)
CommitMultipleFiles commits many files atomically to a branch
func (*Client) CreateBranch ¶
func (c *Client) CreateBranch(ctx context.Context, owner, repo, branchName, baseBranch string) (*githubapi.Reference, error)
CreateBranch creates a new branch from baseBranch
func (*Client) CreateComment ¶
func (c *Client) CreateComment(ctx context.Context, owner, repo string, number int, comment string) (*githubapi.IssueComment, error)
CreateComment adds a comment to an issue or pr
func (*Client) CreateFromTemplate ¶
func (c *Client) CreateFromTemplate(ctx context.Context, tmplOwner, tmplRepo, newName, owner string) (*githubapi.Repository, error)
CreateFromTemplate makes a new repository from a template
func (*Client) CreateIssue ¶
func (c *Client) CreateIssue(ctx context.Context, owner, repo, title, body string) (*githubapi.Issue, error)
CreateIssue opens a new issue
func (*Client) CreatePullRequest ¶
func (c *Client) CreatePullRequest(ctx context.Context, owner, repo, title, head, base, body string) (*githubapi.PullRequest, error)
CreatePullRequest opens a pull request
func (*Client) CreateRepository ¶
func (c *Client) CreateRepository(ctx context.Context, name, description string, private bool) (*githubapi.Repository, error)
CreateRepository creates a new repository under the authenticated actor
func (*Client) GetFileContent ¶
func (c *Client) GetFileContent(ctx context.Context, owner, repo, path, ref string) (string, *githubapi.RepositoryContent, error)
GetFileContent retrieves file content from a repo.
func (*Client) GetInstallation ¶ added in v0.0.3
func (c *Client) GetInstallation(ctx context.Context, installationID int64) (*githubapi.Installation, error)
GetInstallation retrieves details about a specific installation using the client's authentication.
func (*Client) ListBranches ¶
ListBranches lists all branches in a repository
func (*Client) ListCommits ¶
func (c *Client) ListCommits(ctx context.Context, owner, repo string, opts *githubapi.CommitsListOptions) ([]*githubapi.RepositoryCommit, error)
ListCommits lists commits on a branch.
func (*Client) ListIssues ¶
func (c *Client) ListIssues(ctx context.Context, owner, repo string, opts *githubapi.IssueListByRepoOptions) ([]*githubapi.Issue, error)
ListIssues lists issues for a repo
func (*Client) ListPullRequests ¶
func (c *Client) ListPullRequests(ctx context.Context, owner, repo string, opts *githubapi.PullRequestListOptions) ([]*githubapi.PullRequest, error)
ListPullRequests lists pull requests for a repo
func (*Client) ListRepositories ¶
ListRepositories lists repositories accessible to the client