Documentation
¶
Overview ¶
Package github provides access to GitHub via the go-github SDK.
Index ¶
- type Client
- func (c *Client) CloseIssue(ctx context.Context, repo string, number int) error
- func (c *Client) ClosePR(ctx context.Context, repo string, number int) error
- func (c *Client) CommentIssue(ctx context.Context, repo string, number int, body string) error
- func (c *Client) CommentPR(ctx context.Context, repo string, number int, body string) error
- func (c *Client) CreateIssue(ctx context.Context, in operations.IssueInput) (operations.IssueDetail, error)
- func (c *Client) CreatePR(ctx context.Context, in operations.PRInput) (operations.PRDetail, error)
- func (c *Client) CreateRepo(ctx context.Context, in operations.RepoInput) (operations.Repo, error)
- func (c *Client) DeleteRepo(ctx context.Context, fullName string) error
- func (c *Client) FetchSpec(ctx context.Context, repo string, number int) (operations.FetchSpec, error)
- func (c *Client) GetIssue(ctx context.Context, repo string, number int) (operations.IssueDetail, error)
- func (c *Client) GetPR(ctx context.Context, repo string, number int) (operations.PRDetail, error)
- func (c *Client) ListIssues(ctx context.Context) ([]operations.Issue, error)
- func (c *Client) ListPRs(ctx context.Context) ([]operations.PR, error)
- func (c *Client) ListProjects(ctx context.Context) ([]operations.Project, error)
- func (c *Client) ListRepos(ctx context.Context) ([]operations.Repo, error)
- func (c *Client) ListRuns(ctx context.Context, fullName string) ([]operations.Run, error)
- func (c *Client) ListWorkflows(ctx context.Context, fullName string) ([]operations.Workflow, error)
- func (c *Client) MergePR(ctx context.Context, repo string, number int, opts operations.MergeOptions) error
- func (c *Client) Name() string
- func (c *Client) PRDiff(ctx context.Context, repo string, number int) (string, error)
- func (c *Client) RenameRepo(ctx context.Context, fullName, newName string) (operations.Repo, error)
- func (c *Client) SetForgeLabel(label string)
- func (c *Client) SetInstance(name string)
- func (c *Client) SetPRReady(ctx context.Context, repo string, number int, ready bool) error
- func (c *Client) SetVisibility(ctx context.Context, fullName string, private bool) (operations.Repo, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client talks to the GitHub API on behalf of the authenticated user.
func New ¶
func New(cfg operations.GitHubConfig) (*Client, error)
New builds a GitHub client from the given credentials.
func (*Client) CloseIssue ¶
CloseIssue closes an issue.
func (*Client) CommentIssue ¶
CommentIssue adds a comment to an issue.
func (*Client) CreateIssue ¶
func (c *Client) CreateIssue(ctx context.Context, in operations.IssueInput) (operations.IssueDetail, error)
CreateIssue opens a new issue.
func (*Client) CreatePR ¶
func (c *Client) CreatePR(ctx context.Context, in operations.PRInput) (operations.PRDetail, error)
CreatePR opens a pull request. An empty Head means the API default, which is the current branch's remote counterpart on the base repository.
func (*Client) CreateRepo ¶
func (c *Client) CreateRepo(ctx context.Context, in operations.RepoInput) (operations.Repo, error)
CreateRepo creates a repository, owned by the authenticated user when input.Owner is empty, or by the given organization otherwise.
func (*Client) DeleteRepo ¶
DeleteRepo deletes a repository. fullName is owner/name.
func (*Client) FetchSpec ¶
func (c *Client) FetchSpec(ctx context.Context, repo string, number int) (operations.FetchSpec, error)
FetchSpec returns how to fetch a pull request head locally.
GitHub publishes every pull request head under refs/pull/N/head, including for forks, so the head commit can be fetched without the fork's URL or a collaborator token on the fork.
func (*Client) GetIssue ¶
func (c *Client) GetIssue(ctx context.Context, repo string, number int) (operations.IssueDetail, error)
GetIssue returns a single issue in full.
func (*Client) ListIssues ¶
ListIssues returns open issues assigned to the authenticated user.
func (*Client) ListProjects ¶
ListProjects lists the authenticated user's (classic) projects.
func (*Client) ListWorkflows ¶
ListWorkflows lists workflow definitions for a repository.
func (*Client) MergePR ¶
func (c *Client) MergePR(ctx context.Context, repo string, number int, opts operations.MergeOptions) error
MergePR merges a pull request.
func (*Client) RenameRepo ¶
RenameRepo renames a repository. fullName is owner/name.
func (*Client) SetForgeLabel ¶
SetForgeLabel overrides the forge label the client stamps on returned resources. Used to give user-named aliases the right identity in listings while the GitHub client does the API work.
func (*Client) SetInstance ¶
SetInstance names this client's instance (default: the forge type).
func (*Client) SetPRReady ¶
SetPRReady toggles a pull request between draft and ready for review.
func (*Client) SetVisibility ¶
func (c *Client) SetVisibility(ctx context.Context, fullName string, private bool) (operations.Repo, error)
SetVisibility changes whether a repository is private. fullName is owner/name.