Documentation ¶
Overview ¶
Package client is an encapsulation of the go-github library.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { IssueAPI RepositoryAPI PullRequestAPI UserAPI OrganizationAPI TeamAPI WithFields(fields logrus.Fields) Client ForPlugin(plugin string) Client }
func NewClientWithFields ¶
NewClientWithFields create a github client.with added logging fields. `getToken` is a generator for the GitHub access token to use.
func NewClientWithSecretAndLogFields ¶
func NewClientWithSecretAndLogFields(secretAgent *secret.Agent, fields logrus.Fields, tokenPath string) (Client, error)
NewClientWithSecretAndLogFields create a github client. 'secretAgent' a agent for get token by file path 'tokenPath' the path of token storage location
type IssueAPI ¶
type IssueAPI interface { CreateIssue(owner, repo, title, body string, milestone int, labels, assignees []string) (int, error) GetIssueLabels(owner, repo string, number int) ([]*github.Label, error) AssignIssue(owner, repo string, number int, assignees []string) error ListIssueComments(owner, repo string, number int) ([]*github.IssueComment, error) AddLabel(owner, repo string, number int, label string) error RemoveLabel(owner, repo string, number int, label string) error CreateComment(owner, repo string, number int, comment string) error DeleteComment(owner, repo string, commentID int64) error }
IssueAPI interface for issue related API actions
type OrganizationAPI ¶
OrganizationAPI interface for organisation related API actions
type PullRequestAPI ¶
type PullRequestAPI interface { ListPRCommits(owner, repo string, number int) ([]*github.RepositoryCommit, error) GetPullRequest(owner, repo string, number int) (*github.PullRequest, error) GetPullRequestChanges(owner, repo string, number int) ([]*github.CommitFile, error) }
PullRequestAPI interface for pull request related API actions
type RepositoryAPI ¶
type RepositoryAPI interface { IsCollaborator(owner, repo, login string) (bool, error) GetSingleCommit(owner, repo, SHA string) (*github.RepositoryCommit, error) }
RepositoryAPI interface for repository related API actions
Click to show internal directories.
Click to hide internal directories.