Documentation
¶
Index ¶
- func Serve(b Bot)
- type Bot
- type GitHubClient
- func (c GitHubClient) AddLabel(ctx context.Context, pr *github.PullRequest, label string) error
- func (c GitHubClient) Client() *github.Client
- func (c GitHubClient) Close(ctx context.Context) error
- func (c GitHubClient) RemoveLabel(ctx context.Context, pr *github.PullRequest, label string) error
- func (c GitHubClient) SetComment(ctx context.Context, pr *github.PullRequest, botName, content string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GitHubClient ¶
type GitHubClient struct {
// contains filtered or unexported fields
}
func NewGitHubClient ¶
func NewGitHubClient(ctx context.Context, org, repo, policyName string) GitHubClient
NewGitHubClient creates a new GitHub client, using a new token from OctoSTS, for the given org, repo and policy name.
A new token is created for each client, and is not refreshed. It can be revoked with Close.
func (GitHubClient) AddLabel ¶
func (c GitHubClient) AddLabel(ctx context.Context, pr *github.PullRequest, label string) error
func (GitHubClient) Client ¶
func (c GitHubClient) Client() *github.Client
func (GitHubClient) RemoveLabel ¶
func (c GitHubClient) RemoveLabel(ctx context.Context, pr *github.PullRequest, label string) error
func (GitHubClient) SetComment ¶
func (c GitHubClient) SetComment(ctx context.Context, pr *github.PullRequest, botName, content string) error
Click to show internal directories.
Click to hide internal directories.