Documentation ¶
Index ¶
- func Ptr[T any](v T) *T
- type AddIssueLabelInput
- type Client
- func (c *Client) AddIssueLabels(ctx context.Context, input AddIssueLabelInput) error
- func (c *Client) ConvertPullRequestToDraft(ctx context.Context, id string) (*PullRequest, error)
- func (c *Client) CreatePullRequest(ctx context.Context, input githubv4.CreatePullRequestInput) (*PullRequest, error)
- func (c *Client) GetPullRequests(ctx context.Context, input GetPullRequestsInput) (*GetPullRequestsPage, error)
- func (c *Client) GetRepositoryBySlug(ctx context.Context, slug string) (*Repository, error)
- func (c *Client) MarkPullRequestReadyForReview(ctx context.Context, id string) (*PullRequest, error)
- func (c *Client) PullRequest(ctx context.Context, id string) (*PullRequest, error)
- func (c *Client) RepoPullRequests(ctx context.Context, opts RepoPullRequestOpts) (RepoPullRequestsResponse, error)
- func (c *Client) UpdatePullRequest(ctx context.Context, input githubv4.UpdatePullRequestInput) (*PullRequest, error)
- type GetPullRequestsInput
- type GetPullRequestsPage
- type PageInfo
- type PullRequest
- type PullRequestOpts
- type RepoPullRequestOpts
- type RepoPullRequestsResponse
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ptr ¶
func Ptr[T any](v T) *T
Ptr returns a pointer to the argument. It's a convenience function to make working with the API easier: since Go disallows pointers-to-literals, and optional input fields are expressed as pointers, this function can be used to easily set optional fields to non-nil primitives. For example, githubv4.CreatePullRequestInput{Draft: Ptr(true)}
Types ¶
type AddIssueLabelInput ¶ added in v0.0.2
type AddIssueLabelInput struct { // The owner of the GitHub repository. Owner string // The name of the GitHub repository. Repo string // The number of the issue or pull request to add a label to. Number int64 // The names of the labels to add to the issue. This will implicitly create // a label on the repository if the label doesn't already exist (this is the // main reason we use the REST API for this call). LabelNames []string }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddIssueLabels ¶ added in v0.0.2
func (c *Client) AddIssueLabels(ctx context.Context, input AddIssueLabelInput) error
AddIssueLabels adds labels to an issue (or pull request, since in GitHub a pull request is a superset of an issue).
func (*Client) ConvertPullRequestToDraft ¶ added in v0.0.8
func (*Client) CreatePullRequest ¶
func (c *Client) CreatePullRequest(ctx context.Context, input githubv4.CreatePullRequestInput) (*PullRequest, error)
func (*Client) GetPullRequests ¶ added in v0.0.4
func (c *Client) GetPullRequests(ctx context.Context, input GetPullRequestsInput) (*GetPullRequestsPage, error)
func (*Client) GetRepositoryBySlug ¶
func (*Client) MarkPullRequestReadyForReview ¶ added in v0.0.8
func (*Client) PullRequest ¶
func (*Client) RepoPullRequests ¶
func (c *Client) RepoPullRequests(ctx context.Context, opts RepoPullRequestOpts) (RepoPullRequestsResponse, error)
func (*Client) UpdatePullRequest ¶ added in v0.0.6
func (c *Client) UpdatePullRequest(ctx context.Context, input githubv4.UpdatePullRequestInput) (*PullRequest, error)
type GetPullRequestsInput ¶ added in v0.0.4
type GetPullRequestsPage ¶ added in v0.0.4
type GetPullRequestsPage struct { PageInfo PullRequests []PullRequest }
type PageInfo ¶
PageInfo contains information about the current/previous/next page of results when using paginated APIs.
type PullRequest ¶
type PullRequest struct { ID string Number int64 Author struct { Login string } HeadRefName string HeadRefOID string BaseRefName string IsDraft bool Mergeable githubv4.MergeableState Merged bool Permalink string State githubv4.PullRequestState Title string Body string PRIVATE_MergeCommit struct { Oid string } `graphql:"mergeCommit"` PRIVATE_TimelineItems struct { Nodes []struct { ClosedEvent struct { Closer struct { Commit struct { Oid string } `graphql:"... on Commit"` } } `graphql:"... on ClosedEvent"` } } `graphql:"timelineItems(last: 10, itemTypes: CLOSED_EVENT)"` }
func (*PullRequest) BaseBranchName ¶
func (p *PullRequest) BaseBranchName() string
func (*PullRequest) GetMergeCommit ¶ added in v0.0.7
func (p *PullRequest) GetMergeCommit() string
func (*PullRequest) HeadBranchName ¶
func (p *PullRequest) HeadBranchName() string
type PullRequestOpts ¶
type RepoPullRequestOpts ¶
type RepoPullRequestsResponse ¶
type RepoPullRequestsResponse struct { PageInfo TotalCount int64 PullRequests []PullRequest }
type Repository ¶
Click to show internal directories.
Click to hide internal directories.