Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoGithubClient = errors.New("no github client configured for owner") ErrNoGithubGQLClient = errors.New("no github gql client configured for owner") )
Functions ¶
func NewGithubTokenSource ¶
func NewGithubTokenSource(client AppClient, installationID int64) oauth2.TokenSource
Types ¶
type AppClient ¶
type AppsTransport ¶
type AppsTransport struct {
// contains filtered or unexported fields
}
AppsTransport provides a http.RoundTripper by wrapping an existing http.RoundTripper and provides GitHub Apps authentication as a GitHub App.
client can also be overwritten, and is useful to change to one which provides retry logic if you do experience retryable errors.
func NewAppsTransport ¶
func NewAppsTransport(baseUrl string, tr http.RoundTripper, appID int64, key *memguard.Enclave) *AppsTransport
NewAppsTransport returns an AppsTransport using a memguard.Enclave containing a crypto/rsa.(*PrivateKey).
type InstallationClient ¶
type InstallationClient interface {
GetRateLimits(ctx context.Context, owner string) (model.RateLimits, error)
GetUser(ctx context.Context, owner, login string) (model.User, error)
GetReposByOwner(ctx context.Context, owner string) ([]model.Repository, error)
GetRepo(ctx context.Context, owner, repoName string) (model.Repository, error)
PostIssue(ctx context.Context, owner, repoName string, issue model.IssueRequest) error
UpdateIssue(ctx context.Context, owner, repoName string, number int, issue model.IssueRequest) error
GetIssuesByRepo(ctx context.Context, owner, repoName string, options IssueListByRepoOptions) ([]model.Issue, error)
GetEnrichedIssues(ctx context.Context, owner, repoName string, state model.IssueState) (map[int]model.EnrichedIssue, error)
PutIssue(ctx context.Context, owner, repoName string, issue model.IssueRequest) error
EnrichIssue(ctx context.Context, owner, repoName string, issues model.Issue) model.EnrichedIssue
GetPullRequests(ctx context.Context, owner, repoName string) ([]model.PullRequest, error)
PostPullRequest(ctx context.Context, owner, repoName string, pullRequestType model.PullRequestType, title, body, head, base string) (model.PullRequest, error)
GetIssuePullRequest(ctx context.Context, owner, repoName string, issueNumber int) (*string, error)
GetIssueEvents(ctx context.Context, owner, repoName string, issueNumber int) ([]model.IssueEvent, error)
ValidateWebHookEvent(request *http.Request) (interface{}, error)
GetComments(ctx context.Context, owner, repoName string, issueNumber int) ([]model.IssueComment, error)
PostComment(ctx context.Context, owner, repoName string, issueNumber int, comment string) error
UpdateComment(ctx context.Context, owner, repoName string, commentID int64, comment string) error
DeleteComment(ctx context.Context, owner, repoName string, commentID int64) error
GetLabels(ctx context.Context, owner, repoName string) ([]model.Label, error)
PostLabel(ctx context.Context, owner, repoName string, label model.Label) error
GetFile(ctx context.Context, owner, repoName, name string) (model.File, error)
GetBranches(ctx context.Context, owner, repoName string) ([]string, error)
GetCommitHash(ctx context.Context, owner, repoName, branchName string) (string, error)
PostBranch(ctx context.Context, owner, repoName, branchName, commitHash string) error
PostFile(ctx context.Context, owner, repoName, branch, path, content, message, authorName, authorEmail, authorLogin string) error
UpdateFile(ctx context.Context, owner, repoName, branch, path, content, message, authorName, authorEmail, authorLogin, sha string) error
AddInstallation(owner string, installationID int64) error
AddGitHubClient(owner string, client *github.Client)
CheckInstallation(owner string) bool
}
type IssueListByRepoOptions ¶
type IssueListByRepoOptions struct {
Labels []string
State *model.IssueState
Assignee *string
}
IssueListByRepoOptions specifies filtering options to be passed to the GetIssuesByRepo method.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.