Documentation
¶
Index ¶
Constants ¶
View Source
const ( SecondaryRateLimitResponse = "" /* 136-byte string literal not displayed */ SecondaryRateLimitStatusCode = 403 ResourceGoneStatusCode = 410 IssuesDisabledForRepoResponse = "Issues are disabled for this repo" PullRequestAlreadyExistsForBranchError = "A pull request already exists for" )
View Source
const (
PersonalAccessTokenEnvVar = "GITHUB_TOKEN"
)
Variables ¶
This section is empty.
Functions ¶
func GetGithubToken ¶
Types ¶
type Client ¶
type Client struct { Git GitClient Repositories RepoClient PullRequests PullRequestClient Issues IssueClient }
type GitClient ¶
type GitClient interface { GetRef(ctx context.Context, owner string, repo string, ref string) (*github.Reference, *github.Response, error) CreateRef(ctx context.Context, owner string, repo string, ref *github.Reference) (*github.Reference, *github.Response, error) CreateTree(ctx context.Context, owner string, repo string, baseTree string, entries []*github.TreeEntry) (*github.Tree, *github.Response, error) CreateCommit(ctx context.Context, owner string, repo string, commit *github.Commit) (*github.Commit, *github.Response, error) UpdateRef(ctx context.Context, owner string, repo string, ref *github.Reference, force bool) (*github.Reference, *github.Response, error) }
type GitHubUser ¶
type GitHubUser struct {
// contains filtered or unexported fields
}
func NewGitHubUser ¶
func NewGitHubUser(user, email, token string) GitHubUser
func (GitHubUser) Email ¶
func (ghu GitHubUser) Email() string
func (GitHubUser) Token ¶
func (ghu GitHubUser) Token() string
func (GitHubUser) User ¶
func (ghu GitHubUser) User() string
type IssueClient ¶
type PullRequestClient ¶
type PullRequestClient interface { Get(ctx context.Context, owner string, repo string, number int) (*github.PullRequest, *github.Response, error) Create(ctx context.Context, owner string, repo string, pull *github.NewPullRequest) (*github.PullRequest, *github.Response, error) List(ctx context.Context, owner string, repo string, opts *github.PullRequestListOptions) ([]*github.PullRequest, *github.Response, error) }
type RepoClient ¶
type RepoClient interface { GetCommit(ctx context.Context, owner, repo, sha string, opts *github.ListOptions) (*github.RepositoryCommit, *github.Response, error) GetContents(ctx context.Context, owner, repo, path string, opts *github.RepositoryContentGetOptions) (fileContent *github.RepositoryContent, directoryContent []*github.RepositoryContent, resp *github.Response, err error) }
Click to show internal directories.
Click to hide internal directories.