Documentation ¶
Overview ¶
Package github provides convenience wrappers around the go-github package.
Index ¶
- type Client
- type ConcreteClient
- func (c *ConcreteClient) CreateComment(repo models.Repo, pull models.PullRequest, comment string) error
- func (c *ConcreteClient) GetModifiedFiles(repo models.Repo, pull models.PullRequest) ([]string, error)
- func (c *ConcreteClient) GetPullRequest(repo models.Repo, num int) (*github.PullRequest, *github.Response, error)
- func (c *ConcreteClient) PullIsApproved(repo models.Repo, pull models.PullRequest) (bool, error)
- func (c *ConcreteClient) UpdateStatus(repo models.Repo, pull models.PullRequest, state string, description string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { GetModifiedFiles(repo models.Repo, pull models.PullRequest) ([]string, error) CreateComment(repo models.Repo, pull models.PullRequest, comment string) error PullIsApproved(repo models.Repo, pull models.PullRequest) (bool, error) GetPullRequest(repo models.Repo, num int) (*github.PullRequest, *github.Response, error) UpdateStatus(repo models.Repo, pull models.PullRequest, state string, description string, context string) error }
type ConcreteClient ¶
type ConcreteClient struct {
// contains filtered or unexported fields
}
ConcreteClient is used to perform GitHub actions.
func NewClient ¶
func NewClient(hostname string, user string, pass string) (*ConcreteClient, error)
NewClient returns a valid GitHub client.
func (*ConcreteClient) CreateComment ¶
func (c *ConcreteClient) CreateComment(repo models.Repo, pull models.PullRequest, comment string) error
CreateComment creates a comment on the pull request.
func (*ConcreteClient) GetModifiedFiles ¶
func (c *ConcreteClient) GetModifiedFiles(repo models.Repo, pull models.PullRequest) ([]string, error)
GetModifiedFiles returns the names of files that were modified in the pull request. The names include the path to the file from the repo root, ex. parent/child/file.txt.
func (*ConcreteClient) GetPullRequest ¶
func (c *ConcreteClient) GetPullRequest(repo models.Repo, num int) (*github.PullRequest, *github.Response, error)
GetPullRequest returns the pull request.
func (*ConcreteClient) PullIsApproved ¶
func (c *ConcreteClient) PullIsApproved(repo models.Repo, pull models.PullRequest) (bool, error)
PullIsApproved returns true if the pull request was approved.
func (*ConcreteClient) UpdateStatus ¶
func (c *ConcreteClient) UpdateStatus(repo models.Repo, pull models.PullRequest, state string, description string, context string) error
UpdateStatus updates the status badge on the pull request. See https://github.com/blog/1227-commit-status-api.
Click to show internal directories.
Click to hide internal directories.