Documentation
¶
Index ¶
- Constants
- func FormatResponse(ic github.IssueComment, s string) string
- func RegisterIssueCommentHandler(name string, fn IssueCommentHandler)
- func RegisterPullRequestHandler(name string, fn PullRequestHandler)
- func RegisterPushEventHandler(name string, fn PushEventHandler)
- func RegisterStatusEventHandler(name string, fn StatusEventHandler)
- type IssueCommentHandler
- type PluginAgent
- func (pa *PluginAgent) IssueCommentHandlers(owner, repo string) map[string]IssueCommentHandler
- func (pa *PluginAgent) Load(path string) error
- func (pa *PluginAgent) PullRequestHandlers(owner, repo string) map[string]PullRequestHandler
- func (pa *PluginAgent) PushEventHandlers(owner, repo string) map[string]PushEventHandler
- func (pa *PluginAgent) Start(path string) error
- func (pa *PluginAgent) StatusEventHandlers(owner, repo string) map[string]StatusEventHandler
- type PluginClient
- type PullRequestHandler
- type PushEventHandler
- type StatusEventHandler
Constants ¶
const AboutThisBot = "" /* 498-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func FormatResponse ¶
func FormatResponse(ic github.IssueComment, s string) string
FormatResponse nicely formats a response to an issue comment.
func RegisterIssueCommentHandler ¶
func RegisterIssueCommentHandler(name string, fn IssueCommentHandler)
func RegisterPullRequestHandler ¶
func RegisterPullRequestHandler(name string, fn PullRequestHandler)
func RegisterPushEventHandler ¶
func RegisterPushEventHandler(name string, fn PushEventHandler)
func RegisterStatusEventHandler ¶
func RegisterStatusEventHandler(name string, fn StatusEventHandler)
Types ¶
type IssueCommentHandler ¶
type IssueCommentHandler func(PluginClient, github.IssueCommentEvent) error
type PluginAgent ¶
type PluginAgent struct {
PluginClient
// contains filtered or unexported fields
}
func (*PluginAgent) IssueCommentHandlers ¶
func (pa *PluginAgent) IssueCommentHandlers(owner, repo string) map[string]IssueCommentHandler
IssueCommentHandlers returns a map of plugin names to handlers for the repo.
func (*PluginAgent) Load ¶
func (pa *PluginAgent) Load(path string) error
Load attempts to load config from the path. It returns an error if either the file can't be read or it contains an unknown plugin.
func (*PluginAgent) PullRequestHandlers ¶
func (pa *PluginAgent) PullRequestHandlers(owner, repo string) map[string]PullRequestHandler
PullRequestHandlers returns a map of plugin names to handlers for the repo.
func (*PluginAgent) PushEventHandlers ¶
func (pa *PluginAgent) PushEventHandlers(owner, repo string) map[string]PushEventHandler
PushEventHandlers returns a map of plugin names to handlers for the repo.
func (*PluginAgent) Start ¶
func (pa *PluginAgent) Start(path string) error
Start starts polling path for plugin config. If the first attempt fails, then start returns the error. Future errors will halt updates but not stop.
func (*PluginAgent) StatusEventHandlers ¶
func (pa *PluginAgent) StatusEventHandlers(owner, repo string) map[string]StatusEventHandler
StatusEventHandlers returns a map of plugin names to handlers for the repo.
type PluginClient ¶
type PluginClient struct {
GitHubClient *github.Client
KubeClient *kube.Client
JobAgent *jobs.JobAgent
Logger *logrus.Entry
}
PluginClient may be used concurrently, so each entry must be thread-safe.
type PullRequestHandler ¶
type PullRequestHandler func(PluginClient, github.PullRequestEvent) error
type PushEventHandler ¶
type PushEventHandler func(PluginClient, github.PushEvent) error
type StatusEventHandler ¶
type StatusEventHandler func(PluginClient, github.StatusEvent) error