Documentation
¶
Overview ¶
Package github is http client for GitHub API. This package is wrapper for google/go-github package.
Index ¶
- Variables
- func NewGitHubRepository(client *Client) repository.GitHubRepository
- type APIError
- type Client
- type GitHubRepository
- func (c *GitHubRepository) GetFirstCommit(ctx context.Context, owner, repository string, number int) (*model.Commit, error)
- func (c *GitHubRepository) ListCommitsInPR(ctx context.Context, owner, repo string, number int) ([]*model.Commit, error)
- func (c *GitHubRepository) ListPullRequests(ctx context.Context, owner, repo string) ([]*model.PullRequest, error)
- func (c *GitHubRepository) ListRepositories(ctx context.Context) ([]*model.Repository, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoPullRequest means "there is no pull request in this repository" ErrNoPullRequest = errors.New("there is no pull request in this repository") // ErrNoCommit means "there is no commit in this repository" ErrNoCommit = errors.New("there is no commit in this repository") )
Functions ¶
func NewGitHubRepository ¶
func NewGitHubRepository(client *Client) repository.GitHubRepository
NewGitHubRepository initialize repository.GitHubRepository
Types ¶
type APIError ¶
type APIError struct {
// StatusCode is HTTP status code from GitHub.
StatusCode int
// Message is error message
Message string
}
APIError is error for GitHub API.
type GitHubRepository ¶
type GitHubRepository struct {
// contains filtered or unexported fields
}
GitHubRepository is http client for GitHub API
func (*GitHubRepository) GetFirstCommit ¶ added in v0.0.2
func (c *GitHubRepository) GetFirstCommit(ctx context.Context, owner, repository string, number int) (*model.Commit, error)
GetFirstCommit return first commit in the pull request.
func (*GitHubRepository) ListCommitsInPR ¶
func (c *GitHubRepository) ListCommitsInPR(ctx context.Context, owner, repo string, number int) ([]*model.Commit, error)
ListCommitsInPR return List the commits in the PR. oreder is newest to oldest.
func (*GitHubRepository) ListPullRequests ¶
func (c *GitHubRepository) ListPullRequests(ctx context.Context, owner, repo string) ([]*model.PullRequest, error)
ListPullRequests return List the pull requests.
func (*GitHubRepository) ListRepositories ¶
func (c *GitHubRepository) ListRepositories(ctx context.Context) ([]*model.Repository, error)
ListRepositories return List the repositories for a user.
Click to show internal directories.
Click to hide internal directories.