Documentation
¶
Index ¶
- type Client
- func (c *Client) AddLabels(ctx context.Context, org, repo string, number int, labels []string) error
- func (c *Client) CreateComment(ctx context.Context, org, repo string, number int, body string) error
- func (c *Client) GetFileContent(ctx context.Context, org, repo, path, ref string) ([]byte, error)
- func (c *Client) GetIssue(ctx context.Context, org, repo string, number int) (*github.Issue, error)
- func (c *Client) ListComments(ctx context.Context, org, repo string, number int, ...) ([]*github.IssueComment, *github.Response, error)
- func (c *Client) ListIssues(ctx context.Context, org, repo string, opts *github.IssueListByRepoOptions) ([]*github.Issue, *github.Response, error)
- func (c *Client) TransferIssue(ctx context.Context, org, repo string, number int, targetRepo string) 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 wraps the GitHub API client.
func NewClient ¶
NewClient creates a new GitHub client using the provided token. If token is empty, it returns an unauthenticated client.
func (*Client) AddLabels ¶
func (c *Client) AddLabels(ctx context.Context, org, repo string, number int, labels []string) error
AddLabels adds labels to an issue.
func (*Client) CreateComment ¶
func (c *Client) CreateComment(ctx context.Context, org, repo string, number int, body string) error
CreateComment posts a comment on an issue.
func (*Client) GetFileContent ¶ added in v0.0.4
GetFileContent fetches the raw content of a file from a repository. ref can be a branch, tag, or commit SHA. If empty, the default branch is used.
func (*Client) ListComments ¶ added in v0.0.3
func (c *Client) ListComments(ctx context.Context, org, repo string, number int, opts *github.IssueListCommentsOptions) ([]*github.IssueComment, *github.Response, error)
ListComments fetches comments for a specific issue.
func (*Client) ListIssues ¶ added in v0.0.3
func (c *Client) ListIssues(ctx context.Context, org, repo string, opts *github.IssueListByRepoOptions) ([]*github.Issue, *github.Response, error)
ListIssues fetches a list of issues from the repository. options can be used to filter by state, labels, etc. If options is nil, default options are used.
func (*Client) TransferIssue ¶
func (c *Client) TransferIssue(ctx context.Context, org, repo string, number int, targetRepo string) error
TransferIssue transfers an issue to another repository. Note: Transferring issues via API requires the user to have admin access. targetRepo should be in "owner/repo" format.
TODO: GitHub's REST API for issue transfers is complex and may require GraphQL. This is not yet implemented. See https://docs.github.com/en/graphql/reference/mutations#transferissue